Date Conversion From Yyyy Mm Dd Hh:mm:ss (with Space) To dd/mm/yyyy = Date And hh:mm: (1 Viewer)

macmax

New member
Local time
Today, 00:52
Joined
Jan 25, 2016
Messages
1
I am trying to convert the field date and hour from a table attached at my database, with the field name 'TIMESTAMP' with the data type Date and layout YYYY MM DD, into DD/MM/YYYY, does anyone know the code to do this, please? Before I used to write these functions in my queries:

DATE: ValDate([Timestamp])
TIME: Hour([Timestamp]) & ":" & Minute([Timestamp]) & ":" & Seconde([Timestamp])

But these codes doesn't work anymore :banghead: , any ideas?

Thanks
 

cyanidem

Nieóhfytny jaszczomp
Local time
Today, 08:52
Joined
Nov 30, 2015
Messages
106
I'll copy/paste my answer from other forum:

I doubt they ever worked, unless ValDate and Seconde were custom functions.
First, you shouldn't use reserved words (date, time, name, etc.) as object names in Access. It will work in this case, but may cause trouble later on.
Anyway, some mistakes I spotted:
- ValDate should probably be DateValue
- Seconde should be Second
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:52
Joined
May 7, 2009
Messages
19,241
since it is a Date/Time field, you just simply format it:

Date:CDate(Format([TimeStamp], "dd/mm/yyyy"))
Time: Format([TimStamp],"hh:mm:ss")
 

Users who are viewing this thread

Top Bottom