Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date Format Change

Hi,

   I am Connecting Sql Server from QV. Given below is my data in sql server. I have to give the date as 01.10.2013, 02.10.2013,03.10.2013  in dimension. But if i change the date format in edit script. It Shows an error as

ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: 'Date' is not a recognized built-in function name.   Please Provide me a solution as ASAP and where i have to provide that

Date                       State                      Value

10.01.2013 12.00    Madhya Pradesh   10,000.00

10.02.2013 16.00    Andra Pradesh      15,000.00

10.03.2013 20.00    Uttar Pradesh        25,000.00

1 Solution

Accepted Solutions
Not applicable
Author

Hi

  Thank you for your suggestion. The function is Date(Date#(mid(pst_date,1,10),'MM/DD/YYYY') ,'DD/MM/YYYY')

View solution in original post

5 Replies
swuehl
MVP
MVP

You can use the QV script functions like Date() or Date#() only within the LOAD part, not within the SQL statement.

I am assuming, your current statement looks like:

SQL SELECT DateField FROM ...;

Then try

LOAD

    Date( floor(Date#(DateField,'MM.DD.YYYY hh.mm')),'DD.MM.YYYY') as DateField;

SELECT DateField FROM ...;

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

That sounds like you are trying to use a qlikview function inside an sql statement. Qlikview does not parse sql statements at all, but sends them to the database for execution. That means that the sql statement can only contain functions that the sql database understands. If you want to format the date in sql you'll have to use the cast or convert function. See SQL Server Helper - Tips and Tricks - Date Formats


talk is cheap, supply exceeds demand
Not applicable
Author


hi ,Sakathivel S.


you can use this Function

try it


Date(Date#(DateField, 'YYYYMMDD'), 'M/D/YY').

Not applicable
Author

Hi

  Thank you for your suggestion. The function is Date(Date#(mid(pst_date,1,10),'MM/DD/YYYY') ,'DD/MM/YYYY')

Not applicable
Author

Hi G Wassenaar

           Thanks for your suggestion. It was very helpful to me.