dbTalk Databases Forums  

Problems with Date Time Field Criterias

comp.databases.ms-access comp.databases.ms-access


Discuss Problems with Date Time Field Criterias in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kren
 
Posts: n/a

Default Problems with Date Time Field Criterias - 07-29-2003 , 10:59 AM







I have a DateTime Field in a query [DateTime] . I'm trying to set up a
criteria that will show only events before a particular date. To do
this I set the criteria to: <[enter Time and Date]

How ever no matter what date and time I enter the result is nothing.

When I tried the opposite to get only events after a particular date
and time (ie. >[enter Date and Time] ) It returned every entry in
the query no matter what date and time I enter.

a sample of the data field is as follows:

DateTime
__________________

07/02/2003 8:00 AM
07/02/2003 12:00 PM
07/03/2003 10:00 AM
07/03/2003 2:00 PM
07/04/2003 1:00 PM
07/04/2003 5:30 PM


with criteria is set to: <[enter Time and Date]

If I enter 07/03/2003 12:00 PM
It returns no results


with criteria is set to: >[enter Time and Date]

If I enter 07/03/2003 12:00 PM
It returns all 6 results

Can someone please help me out. I've lost a lot of hair this week.

Thanks,

Rob

Reply With Quote
  #2  
Old   
Allen Browne
 
Posts: n/a

Default Re: Problems with Date Time Field Criterias - 07-29-2003 , 11:40 AM






Access appears to be misunderstanding the data type somewhere.

In query design view, select Parameters on the Query menu, and delcare your
parameter (using exactly the same spelling). This way you can specify its
data type.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to the newsgroup. (Email address has spurious "_SpamTrap")

"Kren" <Kren (AT) hotmail (DOT) com> wrote

Quote:
I have a DateTime Field in a query [DateTime] . I'm trying to set up a
criteria that will show only events before a particular date. To do
this I set the criteria to: <[enter Time and Date]

How ever no matter what date and time I enter the result is nothing.

When I tried the opposite to get only events after a particular date
and time (ie. >[enter Date and Time] ) It returned every entry in
the query no matter what date and time I enter.

a sample of the data field is as follows:

DateTime
__________________

07/02/2003 8:00 AM
07/02/2003 12:00 PM
07/03/2003 10:00 AM
07/03/2003 2:00 PM
07/04/2003 1:00 PM
07/04/2003 5:30 PM


with criteria is set to: <[enter Time and Date]

If I enter 07/03/2003 12:00 PM
It returns no results


with criteria is set to: >[enter Time and Date]

If I enter 07/03/2003 12:00 PM
It returns all 6 results

Can someone please help me out. I've lost a lot of hair this week.

Thanks,

Rob



Reply With Quote
  #3  
Old   
Kren
 
Posts: n/a

Default Re: Problems with Date Time Field Criterias - 07-29-2003 , 01:13 PM




That did it.

Many Thanks!!!

On Tue, 29 Jul 2003 16:40:23 GMT, "Allen Browne"
<abrowne1_SpamTrap (AT) bigpond (DOT) net.au> wrote:

Quote:
Access appears to be misunderstanding the data type somewhere.

In query design view, select Parameters on the Query menu, and delcare your
parameter (using exactly the same spelling). This way you can specify its
data type.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.