Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to change date format


Hi,

I have to reload script as below:

Table:

LOAD ID,

    FinancialYr,

 

SQL SELECT *

FROM company

WHERE Datecreated>'03/12/2012';

I am getting error as Date format mismatch when loading this

pleasecan anyone help me how to change this.

thanks.

7 Replies
Michiel_QV_Fan
Specialist
Specialist

Define your date format as needed with the date syntax:

Date('Your field', 'DD/MM/YYYY')

Not applicable
Author

Hi,

Thanks and it is showing below error when I am using this please help

Wrong number of arguments used with function in query expression 'Date(DateLogged,'DD/MM/YYYY')>'03/07/2013'.

Michiel_QV_Fan
Specialist
Specialist

Maybe a datetime format?

If DateLogged is datetime you can add floor to the statement to loose the timepart:

Date(floor(DateLogged, 'DD/MM/YYYY') > '03/07/2013'

Anonymous
Not applicable
Author

convert(varchar(30),getdate(),10)  10 denotes formats,change different value for 10 you will get your format

Not applicable
Author

This link may help you convert your format.

http://sqlusa.com/bestpractices/datetimeconversion/

Not applicable
Author

If your DB is SQL Server, SQL SELECT * FROM company WHERE Datecreated>'03/12/2012'; should work

If your DB is Oracle, SQL SELECT * FROM company WHERE Datecreated>TO_DATE('03/12/2012','DD/MM/YYYY');

should work.

Colin-Albert

I would recommend using dates formatted as 'YYYY-MM-DD' when passing dates to SQL as this format does not have any confusion between Months & Days.

A date '03/01/2013' can be read as  Jan 3rd 2013 or March 1st 2013 depending if your in Europe or USA.

Also check the DateFormat string on the first tab of your QlikView load script which shows the system date setting, but this may not match how SQL is configured!

Try

     SQL SELECT *

     FROM company

     WHERE Datecreated > '2012-12-03' ;