Datepart Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I wanted to know if you can use the datepart function in a query to extract a
date such as 08/01/2005 from a date/time field such as 08/01/2005 10:55 . I
have a query that asks users for to input a date. The users have to input the
both the date and time since this is the way the data is captured and stored
the table. I want the users to only input a date without the time. I was
thinkng of using the datapart function but did not know if it would work.
 
Use DateValue() to strip off the time (or TimeValue() to strip off the
date.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
You can use
Where Format(MyDateField,"dd/mm/yyyy") = format([Enter date
here:],"dd/mm/yyyy")

If you use a beween criteria you'll have to covert it to date
Where cvdate(Format(MyDateField,"dd/mm/yyyy") between cvdate(format([Enter
Start date here:],"dd/mm/yyyy")) and cvdate(format([Enter End date
here:],"dd/mm/yyyy"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DatePart 1
Datepart Function 1
datepart function 2
DateTime field 3
Format DatePart 4
Type mismatch in Function 5
Filtering by Month 1
select case function on date/time 1

Back
Top