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

help converting date and time field using query

P: 27
I have a table that creates a value in the field using the now() function.

The data stored, of course, is in the format of 12/4/06 12:44:00 PM.

I would like to make a query that uses only the date part of that field, however, if I use the datevalue function within the query, it says that there is an error in the expression.

I am somewhat in a loss because I thought it should work...
Dec 4 '06 #1
Share this Question
Share on Google+
2 Replies


NeoPa
Expert Mod 15k+
P: 31,661
Without seeing the SQL of you're query it's impossible to comment.
You may have a typo that's causing the error.
You're right that you should be able to access just the date part of the field though, if that helps.
Dec 4 '06 #2

ADezii
Expert 5K+
P: 8,669
I have a table that creates a value in the field using the now() function.

The data stored, of course, is in the format of 12/4/06 12:44:00 PM.

I would like to make a query that uses only the date part of that field, however, if I use the datevalue function within the query, it says that there is an error in the expression.

I am somewhat in a loss because I thought it should work...
'As an alternative, you could always create a Calculated Field in the Query and
'format the Date derived from the Now() Function:

'Assuming your Field is MyDate and the Calculated Field is named NewDate:
Expand|Select|Wrap|Line Numbers
  1. NewDate: Format([MyDate],"mm/dd/yy")
Dec 5 '06 #3

Post your reply

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