Wierd Date field behaviour - the culprit

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Wierd Date field behaviour - the culprit

Postby rochard » Mon Mar 22, 2004 4:12 pm

In Find mode, I type a date into a date time field and get the following error message:

Invalid input '08/12/2002', didn't comply to the format 'MM/DD/YYYY'

On another table, I enter a range 08/12/2002...08/18/2002 and it finds all records.

On another table, a date field will not accept a change.

If this has happened to you, check the format properties. I had set them, inadvertently, to DD-MM-YYYY instead of DD/MM/YYYY and was entering dates as DD/MM/YYYY
Michael Rochard
rochard
 
Posts: 142
Joined: Thu Jan 29, 2004 12:11 am

Re: Wierd Date field behaviour - the culprit

Postby bcusick » Wed Mar 24, 2004 3:25 am

rochard wrote:In Find mode, I type a date into a date time field and get the following error message:

Invalid input '08/12/2002', didn't comply to the format 'MM/DD/YYYY'

On another table, I enter a range 08/12/2002...08/18/2002 and it finds all records.

On another table, a date field will not accept a change.

If this has happened to you, check the format properties. I had set them, inadvertently, to DD-MM-YYYY instead of DD/MM/YYYY and was entering dates as DD/MM/YYYY


Michael - when you search for a single day - put a # before it:

'#08/12/2002'

This is because SQL databases use date and TIME. So when you use the # - the SQL Parser writes it as '08/12/2002 00:00:00...08/12/2002 23:59:59'

You only need to do this on SINGLE day searches - or specify the TIME elements as well manually.

Hope this helps,

Bob Cusick
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA

wierd date field behaviour

Postby rochard » Wed Mar 24, 2004 3:45 am

Thanks, Bob. That makes perfect sense.
Michael Rochard
rochard
 
Posts: 142
Joined: Thu Jan 29, 2004 12:11 am


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 8 guests

cron