A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date query problem



 
 
Thread Tools Display Modes
  #1  
Old October 28th, 2005, 04:11 PM
CCT
external usenet poster
 
Posts: n/a
Default Date query problem

I need to query a field based on date alone. The data also contains the time
component. When I query as dd/mm/yyy (i.e. #04/19/2000#) I get no results -
if I include time as well it works. I need to query just on date though. I
have tried formatting the query date column with no success. Is there another
way to go about this?

Thanks
  #2  
Old October 28th, 2005, 04:19 PM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default Date query problem

Add a calculated field to your query:
JustTheDate: DateValue([FieldName])

Then use your criterion on this field.

--

Ken Snell
MS ACCESS MVP

"CCT" wrote in message
...
I need to query a field based on date alone. The data also contains the
time
component. When I query as dd/mm/yyy (i.e. #04/19/2000#) I get no
results -
if I include time as well it works. I need to query just on date though. I
have tried formatting the query date column with no success. Is there
another
way to go about this?

Thanks



  #3  
Old October 28th, 2005, 04:39 PM
CCT
external usenet poster
 
Posts: n/a
Default Date query problem

Yep, that did it, TYVM

"Ken Snell [MVP]" wrote:

Add a calculated field to your query:
JustTheDate: DateValue([FieldName])

Then use your criterion on this field.

--

Ken Snell
MS ACCESS MVP

"CCT" wrote in message
...
I need to query a field based on date alone. The data also contains the
time
component. When I query as dd/mm/yyy (i.e. #04/19/2000#) I get no
results -
if I include time as well it works. I need to query just on date though. I
have tried formatting the query date column with no success. Is there
another
way to go about this?

Thanks




  #4  
Old October 28th, 2005, 04:39 PM
John Spencer
external usenet poster
 
Posts: n/a
Default Date query problem

Method one: Change the criteria to
=#04/19/2000# AND #04/20/2000#

If you are using a parameter then use the something like
=[What day?] AND =DateAdd("d",1,[What day?] )


Method two: Use the dateValue function
Make a calculated column
Field: JustTheDate: DateValue([YourDateField])
Criteria: #04/19/2000#




"CCT" wrote in message
...
I need to query a field based on date alone. The data also contains the
time
component. When I query as dd/mm/yyy (i.e. #04/19/2000#) I get no
results -
if I include time as well it works. I need to query just on date though. I
have tried formatting the query date column with no success. Is there
another
way to go about this?

Thanks



 




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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Cat Ain't Working shep Setting Up & Running Reports 15 September 12th, 2005 05:14 PM
Help again from Ken Snell (Query) Randy Running & Setting Up Queries 22 August 29th, 2005 08:15 PM
Here's a shocker Mike Labosh General Discussion 2 October 26th, 2004 05:04 PM
Print Taher Setting Up & Running Reports 1 August 31st, 2004 09:07 PM
Aggregating Date Data into Weeks and Quarters Roger Running & Setting Up Queries 3 July 11th, 2004 05:56 PM


All times are GMT +1. The time now is 04:04 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.