cancel
Showing results for 
Search instead for 
Did you mean: 

Date Format

Former Member
0 Kudos

Hello All,

i want to create a query from the OCRD Database.

the create Date format is DD/MM/YYYY actually. is it possible to get it back in YYYYMMDD?

i tried allready the FORMAT and TO_CHAR function but it didn't work in the SQL Statemant??

Thank you and best regards

Serkan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Serkan,

You may use Cast or Convert to do the job. Convert is the simplest way such as: Convert(varchar(8), GetDate(), 112).

If you need query result for DTW upload, better changing date format under Excel. That would be much easier.

Thanks,

Gordon

Answers (1)

Answers (1)

Former Member
0 Kudos

You will need to use a CONVERT statement, and select the number code which has the right format for you. You can get this from the SQL help files.

example: CONVERT(varchar, T0.DocDate, 112)