jtequia
asked on
Converting a numeric field into a date
I want to take a numeric 8 digit field that holds a number representing a date mmddyyyy, but where the month ranges from 1-9 the number is stored as mddyyyy. I want to convert this into a date field in a query.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
gustav,
Great use of Mod
Great use of Mod
? DateSerial(9012011 Mod 10000,9012011\1000000,9012011\10000 Mod 100)
9/1/2011
? DateSerial(CDbl("9012011") Mod 10000, CDbl("9012011")\1000000,CDbl("9012011")\10000 Mod 100)
9/1/2011
? DateSerial(10012011 Mod 10000,10012011\1000000,10012011\10000 Mod 100)
10/1/2011
? DateSerial(CDbl("10012011") Mod 10000, CDbl("10012011")\1000000,CDbl("10012011")\10000 Mod 100)
10/1/2011
Yes, Mod is very useful in some cases.
/gustav
/gustav
MyDate: DateSerial([YourNumField] Mod 10000,[YourNumField]\10000
/gustav