MS Access: How to strip time off a date field?
Asked Answered
F

2

5

For example a value in a field might be

8/5/2010 11:18:22 AM

And I want to strip it down to

8/5/2010

It is a Date/Time field format

Firsthand answered 14/3, 2013 at 20:59 Comment(3)
When storing or when retrieving? Is this in an Access application, or through ODBC.OLEDB?Longshore
Retrieving. I am currently making a Select query in Design View that involves a table which has this date fieldFirsthand
what langauge do you want? do you want it in a new field? do you want it to change the existing field?Track
F
15

Solved the issue using DateValue()

Firsthand answered 14/3, 2013 at 21:10 Comment(0)
C
0

Time is a decimal place so if you don't want time then update the field using:

round(number,NumDigitsAfterDecimal as long)
Cyrillus answered 28/3, 2021 at 10:47 Comment(1)
Beware Round() will advance the date for times after midday, eg Round(#3/28/2021 13:00#, 0) returns 3/29/2021Anemia

© 2022 - 2024 — McMap. All rights reserved.