Does anyone know why this date format is used. (1 Viewer)

namliam

The Mailman - AWF VIP
Local time
Tomorrow, 00:17
Joined
Aug 11, 2003
Messages
11,695
No standard function. Plus your "new date" isnt really a date yet.... you need to use some conversion function to make it a date (CDate, Dateserial, Datevalue)

Or if you are storing it in a column that is a date field... You are then implicitely converting string to date, doing anything implicit (allowing access to think for you) is not advicable...

Read a bit further mike....
If you are loading it into a table, you are getting implicit conversions... Not advicable...

Analyzing the data you get and normalizing it, like you did is indeed good practice! Job well done I would say !
 

Mike375

Registered User.
Local time
Tomorrow, 08:17
Joined
Aug 28, 2008
Messages
2,548
FixDOB: CDate(Right([Field4],2) & "" & "/" & "" & Mid([Field4],5,2) & "" & "/" & "" & Left([Field4],4)) Sorry:D

FixDOB1: CDate(Right([Field4],2) & "/" & Mid([Field4],5,2) & "/" & Left([Field4],4))

I see what you mean. It made the dates in both fields jump to the right alignment
 

namliam

The Mailman - AWF VIP
Local time
Tomorrow, 00:17
Joined
Aug 11, 2003
Messages
11,695
GRMBL ... NO NO NO... NO NO NO .... NO NO NO NOOOOOOOOOOOOOOOOOOOO

Flipping CDate!!!!! Dont use CDate!!!! Dateserial!
Or if you feel like you must use CDate... atleast use ISO date to ensure you always get the right date.
 

Mike375

Registered User.
Local time
Tomorrow, 08:17
Joined
Aug 28, 2008
Messages
2,548
I must be doing something wrong. I replaced CDate with DateSerial and got a pop up box aboout Expression using wrong numbers.

How CDate use with ISO date. Isn't the 19560130 the ISO date.
 

Mike375

Registered User.
Local time
Tomorrow, 08:17
Joined
Aug 28, 2008
Messages
2,548
If the date, that is from the Right/Mid/Left is simply appended to a date field I assume it has ""to be a date" to append across. Is the problem one whereby some of the records from the Right/Mid/Left will not be a date and thus not append across and with SetWarnings No you would see it?
 

namliam

The Mailman - AWF VIP
Local time
Tomorrow, 00:17
Joined
Aug 11, 2003
Messages
11,695
Syntax for dateserial is: DateSerial(Year, Month, Day)

The ISO date format you need to use for it to work YYYY/MM/DD or YYYY-MM-DD

If some of the records do not comply and compile to a proper date you will get a popup yes....
 

Mike375

Registered User.
Local time
Tomorrow, 08:17
Joined
Aug 28, 2008
Messages
2,548
No wonder my DateSerial caused an Access melt down.

I am going to post a question in General. I have been playing with something today and while we have been posting, however, I think it might be impossible. Perhaps you can have a look for me.
 

Users who are viewing this thread

Top Bottom