G
Guest
I have dates 20060605 and need to convert it to 05/06/2006 - can any one help
Allen Browne said:Assuming your field is named "d" and always contains 8 digits, this will
give you a date/time field:
DateSerial(Left([d], 4], Mid([d],5,2), Right([d],2))
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
UG said:I have dates 20060605 and need to convert it to 05/06/2006 - can any one
help
Sean said:If I have a text field that stores a date and time as text, how do I
convert
it so I can use that field as a date and time to be able to do a datediff
function on it. My data in the field looks like this, 200705031400 and I
need it to show as 2007/05/03 14:00 or something similar. Thanks
Allen Browne said:Assuming your field is named "d" and always contains 8 digits, this will
give you a date/time field:
DateSerial(Left([d], 4], Mid([d],5,2), Right([d],2))
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
UG said:I have dates 20060605 and need to convert it to 05/06/2006 - can any one
help
John Spencer said:ONE method to convert to an actual date time field is
IIF(IsDate(Format([YourField],"@@@@-@@-@@")),CDate(Format([YourField],"@@@@-@@-@@")),Null)
UG said:I have dates 20060605 and need to convert it to 05/06/2006 - can any one
help
Sean said:This does not work, I always get a null value.
John Spencer said:ONE method to convert to an actual date time field is
IIF(IsDate(Format([YourField],"@@@@-@@-@@")),CDate(Format([YourField],"@@@@-@@-@@")),Null)
UG said:I have dates 20060605 and need to convert it to 05/06/2006 - can any one
help
If I have a text field that stores a date and time as text, how do I convert
it so I can use that field as a date and time to be able to do a datediff
function on it. My data in the field looks like this, 200705031400 and I
need it to show as 2007/05/03 14:00 or something similar. Thanks
Jeff Boyce said:Sean
I can't tell what you are referring to when you say "This does not work".
Did you try the DateSerial() function and the other ones I suggested?
Regards
Jeff Boyce
Microsoft Office/Access MVP
Sean said:This does not work, I always get a null value.
John Spencer said:ONE method to convert to an actual date time field is
IIF(IsDate(Format([YourField],"@@@@-@@-@@")),CDate(Format([YourField],"@@@@-@@-@@")),Null)
I have dates 20060605 and need to convert it to 05/06/2006 - can any one
help
Sean said:When I run the query and use:
IIF(IsDate(Format([YourField],"@@@@-@@-@@")),CDate(Format([YourField],"@@@@-@@-@@")),Null)
I always get a null value, it does not convert the date.
The dateserial works but it only gets me the date, I need the time to show
as well becuase I am going to compare two different date times for the
same
item and I need to see the difference between them in hours. Any
thoughts?
Thanks again,
Sean
Jeff Boyce said:Sean
I can't tell what you are referring to when you say "This does not work".
Did you try the DateSerial() function and the other ones I suggested?
Regards
Jeff Boyce
Microsoft Office/Access MVP
Sean said:This does not work, I always get a null value.
:
ONE method to convert to an actual date time field is
IIF(IsDate(Format([YourField],"@@@@-@@-@@")),CDate(Format([YourField],"@@@@-@@-@@")),Null)
I have dates 20060605 and need to convert it to 05/06/2006 - can any
one
help
Jeff Boyce said:Sean
Our postings seem to be missing each other.
John has given you an example of what I was describing in my original
response - the use of the DateSerial() and TimeSerial() functions.
Regards
Jeff Boyce
Microsoft Office/Access MVP
Sean said:When I run the query and use:
IIF(IsDate(Format([YourField],"@@@@-@@-@@")),CDate(Format([YourField],"@@@@-@@-@@")),Null)
I always get a null value, it does not convert the date.
The dateserial works but it only gets me the date, I need the time to show
as well becuase I am going to compare two different date times for the
same
item and I need to see the difference between them in hours. Any
thoughts?
Thanks again,
Sean
Jeff Boyce said:Sean
I can't tell what you are referring to when you say "This does not work".
Did you try the DateSerial() function and the other ones I suggested?
Regards
Jeff Boyce
Microsoft Office/Access MVP
This does not work, I always get a null value.
:
ONE method to convert to an actual date time field is
IIF(IsDate(Format([YourField],"@@@@-@@-@@")),CDate(Format([YourField],"@@@@-@@-@@")),Null)
I have dates 20060605 and need to convert it to 05/06/2006 - can any
one
help
I tried that but I was unable to get the TIME portion to appear. Only a date
was returned 05/04/2007 but the time part, 12:00 was not included in the
results. This is where I am having issues. Any thoughts?
Sean said:I tried that but I was unable to get the TIME portion to appear. Only a
date
was returned 05/04/2007 but the time part, 12:00 was not included in the
results. This is where I am having issues. Any thoughts?
Jeff Boyce said:Sean
Our postings seem to be missing each other.
John has given you an example of what I was describing in my original
response - the use of the DateSerial() and TimeSerial() functions.
Regards
Jeff Boyce
Microsoft Office/Access MVP
Sean said:When I run the query and use:
IIF(IsDate(Format([YourField],"@@@@-@@-@@")),CDate(Format([YourField],"@@@@-@@-@@")),Null)
I always get a null value, it does not convert the date.
The dateserial works but it only gets me the date, I need the time to
show
as well becuase I am going to compare two different date times for the
same
item and I need to see the difference between them in hours. Any
thoughts?
Thanks again,
Sean
:
Sean
I can't tell what you are referring to when you say "This does not
work".
Did you try the DateSerial() function and the other ones I suggested?
Regards
Jeff Boyce
Microsoft Office/Access MVP
This does not work, I always get a null value.
:
ONE method to convert to an actual date time field is
IIF(IsDate(Format([YourField],"@@@@-@@-@@")),CDate(Format([YourField],"@@@@-@@-@@")),Null)
I have dates 20060605 and need to convert it to 05/06/2006 - can
any
one
help