Convert a string to date datatype (1 Viewer)

mansied

Member
Local time
Today, 17:42
Joined
Oct 15, 2020
Messages
99
Hello All,
I have field as a string

2022-07-06 01:54:44.000
2022-06-10 20:43:59.609

1- I want to remove after space ( 01:54:44.000)
2- change the 2022-07-06 to date format

how can I do this in Access query ?
Thank you
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:42
Joined
May 7, 2009
Messages
19,245
you can also try:

cdate(left$([FieldName],instr(1,[FieldName]," ")))
 

Guus2005

AWF VIP
Local time
Today, 23:42
Joined
Jun 26, 2007
Messages
2,641
or try this:
Code:
cdate(split([FieldName]," ")(0))

[edit]
Doesn't work in a query.
Create a function which does this and return a date.
[/edit]
HTH:D
 

Users who are viewing this thread

Top Bottom