How do I select the date portion of a datetime field

R

Ray

I need to query a database from excel to return unique
records by date only from a date time field. I can select
day , Month or year what I need is mm/dd/yyy

Any suggestion
Thank
 
F

Frank Kabel

Hi Ray
try
=DATE(YEAR(A1),MONTH(A1),DAY(A1))
where A1 stores your datetime value
Frank
 
R

Ray

MS Query returns DATE is not a valid function

-----Original Message-----
Hi Ray
try
=DATE(YEAR(A1),MONTH(A1),DAY(A1))
where A1 stores your datetime value
Frank



.
 
F

Frank Kabel

Hi Ray
I would create a helper cell with this formula and reference this
helper cell instead of the original cell in MS Query

HTH
Frank
 
Top