Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SQL Error:'makedate' is not a recognized built-in funtion name

Hello

I'm loading from an SQL Server something like this: (Date comes as a timestamp)

Date:

SQL SELECT
Date,
year( Date ) as Year,
month( Date ) as Month,
day( Date ) as Day,
MakeDate( Year, Month, Day ) as Date_Short,
week( Date_Short ) as Week,
weekday( Date_Short ) as WeekDay,
Year & '-Q' & Ceil( Month/3 ) as YearQtr,
applymap( 'Quarters_Map', Month, null() ) as Quarter,
Date( monthstart( Date ), 'MMM-YY' ) as YearMonth
FROM table_name;


And when I run it, I get the following error:

SQL Error:[Microsoft][ODBC SQL Server Driver][SQL Server] 'makedate' is not a recognized built-in funtion name



What's the matter?!?!?

1 Reply
Not applicable
Author

Hi,

In fact, the code write after the SQL SELECT instruction is executed in the source language
That is to say in your SQL server database, so you have to have the SQL Server syntax.

If you want to use QlikView Syntax, you must use a LOAD without FROM clause before the SQL SELECT

the easier way to do it is to use the wizard : Go in the Script section, add use the option "preceding load". Then select data again in your database.

You will see two level :

Load

Field 1
Field2
...

;

SQL select

Field1
Field 2

FROM Dbo.tablename.

The Script will first execute the SQL Select instruction (so you can use the SQL Server SQL syntax here). Then the Load Statement will be executed and you will be able to use QlikView functions upon field loaded in SQL Select.

Hope it helps

Regards