Two text fields to single datetime field?

10e5x

Registered User.
Local time
Tomorrow, 03:40
Joined
Dec 3, 2012
Messages
16
I was search for the solution for this but realize many of the solutions found are not applicable to ms access 2003.

I have two fields namely Event_D: 30/04/2012 and Event_T: 22:01:18
Both are text data type.
How can i combine this two into a single datetime field Event_DT:
30/04/2012 22:01:18 ?
Format: DD/MM/YYYY HH:MM:SS
Thanks,
10e5x
 
Last edited:
Thanks John,
however will it convert to the format i want? DD/MM/YYYY HH:MM:SS?
 
You could try ...
Code:
= CDate(Me.Event_D & " " & Me. Event_T)
 
Thanks for replying nanscombe,

doesn't work:(
 
You could try it without the extra space. :o

Code:
 Me.Event_DT = CDate(Me.Event_D & " " & Me.Event_T)

The above is using it as a bit of VBA, ie coding.

If you just want to use it as a Control Source for a textbox you could use...

Code:
 Event_DT Control Source
= [Event_D] & " " & [Event_T]
 
Last edited:
Hi nanscombe,

I am using at the select statement...is that possible? If yes, example?

Thanks,
10e5x
 
Oh, are you setting the record source?

Code:
SELECT [Event_D] & ' ' & [Event_T] AS Event_DT FROM ...

Or, if it's a column in a query ..
Code:
Event_DT: [Event_D] & ' ' & [Event_T]

But how would you update the values of Event_D & Event_T? (assuming this is what you are trying to do)
 

Users who are viewing this thread

Back
Top Bottom