thsman
Posts: 27
|
| Posted: 02/14/2012, 6:19 PM |
|
Using the application builder I have created an add/edit/delete form. One field in the database contains opening times in date format. The builder added an ajax inline date picker. I removed this and changed the textbox it was attached to with a listbox. This is populated programatically and is loaded with a list of possible opening times.
In use I want the user's listbox selection to get into the database record either as an edit or a new record. But it is not getting pulled or is not getting pulled correctly.
Any value chosen ends up in the db as 00:00:00. The db (an mdb file) has this field set as a date/time with the format set to hh:mm am/pm as is the listbox in the app.
Any ideas?
I'm using asp as the language for this.
|
 |
 |
andy
Posts: 183
|
| Posted: 02/15/2012, 7:04 AM |
|
Have you checked the date/time format in your database connection settings?
There are the two data/time format fields for the input field's properties (display and database format)... Are these all correctly set?
_________________
Andy
RAD tools for rich UI controls:
http://www.koolphptools.com |
 |
 |
thsman
Posts: 27
|
| Posted: 02/15/2012, 7:20 AM |
|
The connection date format property is set to dd/mm/yyyy HH:nn:ss. There is no time only option there.
I don't know what you mean by display property. Where would that be?
In any case there are other tables such as bookings that contain dates that I want to show as dates. Wouldn't setting this at the connection level defeat showing dates or would I set up multiple connections?
In case I didn't mention it I am using CCS 5
|
 |
 |
andy
Posts: 183
|
| Posted: 02/15/2012, 9:09 AM |
|
Sorry, I was relating to the two properties for a Text Box: namely Format and DBFormat
However, if you are setting it as a listbox, then may be you will need to format the field value before it can be saved to your database as a date formatted correctly for your database.
You may have to change your database field type.
I'm not sure that the Listbox control formats dates and times correctly... I'm guessing that may be the problem.
_________________
Andy
RAD tools for rich UI controls:
http://www.koolphptools.com |
 |
 |
thsman
Posts: 27
|
| Posted: 02/15/2012, 11:23 AM |
|
Ah gotcha.
The times could be stored in the db as strings but at some point in the app I will need to check to see if a time is equal to or later than another time. I can probably work that out with cDate.
Thanks very much for your help.
|
 |
 |
andy
Posts: 183
|
| Posted: 02/15/2012, 12:26 PM |
|
Check out these two functions in your Help file, which can also be useful for parsing and formatting dates:
CCParseDate()
CCFormatDate()
Good luck!
_________________
Andy
RAD tools for rich UI controls:
http://www.koolphptools.com |
 |
 |
thsman
Posts: 27
|
| Posted: 02/15/2012, 2:52 PM |
|
Thanks Andy
|
 |
 |