By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,519 Members | 2,295 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,519 IT Pros & Developers. It's quick & easy.

Converting date and time to just a date field

P: 116
Hope there is someone out there that can help. I am sure this is an easy one although not easy to explain.

I have a form which produces a report using a query. On the form I have a start and end date which is in the query. So >=[forms]![message]![start and <=[forms![message]![end]. If I enter 2 dates it will produce the data I need.

However the date field is a date and time field. in the form if I put say 27/07/07 00:01 to 27/07/07 23:59 it will bring up all records with a time in. However if I just put in 27/07/07 to 27/07/07 it will just bring up all records with no time in.

I need all records. I have tried to convert the date field by formating it Format([date], "dd/mm/yyy") but this doesnt work as it thinks its text. I have tried Datevalue([date]) but this is too complex for the query to run.

Any ideas how i can convert to just date and query on this.


Jul 18 '07 #1
Share this Question
Share on Google+
2 Replies

P: 116

Just sorted thanks. Its because I was starting from 1min past midnight that it did not select all my records.....doh

Jul 18 '07 #2

P: 49
Go back to the underlying table and look at the input maskd - ensure its set to
99/99/0000;0;_ or 99/99/00;0;_ if you just want the last 2 digits of the year.

go to any input forms and check that the input mask is the same there

that way you'll standardise the user input right through and ensure that anyone keying in maintains the same practice

Jul 18 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.