Date Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table with two TEXT fields : Date1, Time
emample of data is :Date: 140406 , Time: 0601p
I want to convert this to DATE format as follows : 060414 : 0601PM
I am using the following in the querry:
TransDtTm:
DateSerial(Right([Date1],2),Mid([Date1],3,2),Left([Date1],2))+TimeSerial(Left([Time],2),Mid([Time],3,2),right([Time],1)

Why is it not working? The date part if done by its own , does work, but the
time part does not...
Could you help , please
 
I bet that you just had the data in one real Date/Time field now....

First of all I'd worry about the + sign as it could do math on the results
which would cause problems. Try the & ampersand instead.

Second instead of using DateSerial and TimeSerial, just format the data to
look like you want it to UNLESS you actually need it to be a Date datatype.
 
Jerry, thanks for the reply...

Yes, I want it to be in date fromat :yymmdd :hhmm AMPM
I tried th & and it does not give the result I need.
Bootom line : I need to convert the two text fields that I import to the
baove format by combining them.
Thanks

Jerry Whittle said:
I bet that you just had the data in one real Date/Time field now....

First of all I'd worry about the + sign as it could do math on the results
which would cause problems. Try the & ampersand instead.

Second instead of using DateSerial and TimeSerial, just format the data to
look like you want it to UNLESS you actually need it to be a Date datatype.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


mn said:
I have a table with two TEXT fields : Date1, Time
emample of data is :Date: 140406 , Time: 0601p
I want to convert this to DATE format as follows : 060414 : 0601PM
I am using the following in the querry:
TransDtTm:
DateSerial(Right([Date1],2),Mid([Date1],3,2),Left([Date1],2))+TimeSerial(Left([Time],2),Mid([Time],3,2),right([Time],1)

Why is it not working? The date part if done by its own , does work, but the
time part does not...
Could you help , please
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Transfer Text 9
Need Help with DateSerial Function 3
Problem with Date Query 6
Help with Union 2
Date Criteria Issue 5
Update Query problem 5
TimeSerial 3
SQL Query between 2 dates 5

Back
Top