Home » Developer & Programmer » Forms » Query by date only
Query by date only [message #234599] Wed, 02 May 2007 11:01 Go to next message
formbldr2k
Messages: 5
Registered: April 2007
Junior Member
Hi all,

I have a table with a field that stores date and time.
In my form, I want to retrieve records specifying only the date part.
I tried to change the block's default_where using the TRUNC function with no luck. Embarassed
Can anyone help?

Thanks in advance!
Re: Query by date only [message #234648 is a reply to message #234599] Wed, 02 May 2007 14:11 Go to previous messageGo to next message
hsinghalmrt
Messages: 51
Registered: March 2005
Member
Dear,

Try after changing format mask of the date_item.
Use MM/DD/YYYY or a mask like this to display date only.


Best Regards,
Himanshu
Re: Query by date only [message #234674 is a reply to message #234648] Wed, 02 May 2007 15:33 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Modify this item's "Data Type" property (in the Property Palette) to DATETIME (I suppose that, at the moment, this item's data type is DATE).

Doing so, entering (for example) 17.12.1980 in query mode and pressing EXECUTE QUERY, you should get the result although record contains time portion with that date (for example, 17.12.1980 02:30).

You'll, of course, FETCH time part as well (but you didn't say you'd like to get rid of it). Do you?
Re: Query by date only [message #234753 is a reply to message #234599] Thu, 03 May 2007 02:07 Go to previous messageGo to next message
imen_mr2004
Messages: 22
Registered: October 2006
Location: tunisia
Junior Member
jsut use a mask format
DD/MM/YYYY


Good luck
Re: Query by date only [message #234920 is a reply to message #234674] Thu, 03 May 2007 08:25 Go to previous messageGo to next message
formbldr2k
Messages: 5
Registered: April 2007
Junior Member
Thank you littlefoot!

Changing the item's datatype to DATETIME and the format mask to MM/DD/YYYY works fine. However, I'm having problems with a toolbar button that increments or decrements the date: If I put manually the date, it works fine. When I use the button it does not work. Embarassed
Re: Query by date only [message #234990 is a reply to message #234599] Thu, 03 May 2007 11:59 Go to previous messageGo to next message
hsinghalmrt
Messages: 51
Registered: March 2005
Member
Can you send the code on the button?
Re: Query by date only [message #235250 is a reply to message #234599] Fri, 04 May 2007 09:03 Go to previous message
formbldr2k
Messages: 5
Registered: April 2007
Junior Member
Thank you all!

The button was changing the item's format mask.
Now everything works fine.

I appreciate your suggestions and time. Keep on helping!! (and make this a better world).
Previous Topic: group by data block
Next Topic: how use replace all grid row with variable value
Goto Forum:
  


Current Time: Fri Dec 13 05:19:52 CST 2024