1 Reply Latest reply: Aug 4, 2009 7:12 PM by Bertrand HERARD RSS

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


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



      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?!?!?

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


          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 :


          Field 1


          SQL select

          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