3 Replies Latest reply: Mar 5, 2010 1:23 PM by Rob Wunderlich RSS

    use date as a variable ?

      i have generate two variable of date like that .. i think is a variable

       


      LOAD
      date(date#(20050101,'YYYYMMDD')+recno(),'DD/MM/YYYY') as "Date_start"
      AUTOGENERATE today() - MakeDate(2005, 1, 1) + 1;

      LOAD
      date(date#(20050101,'YYYYMMDD')+recno(),'DD/MM/YYYY') as "Date_end"
      AUTOGENERATE today() - MakeDate(2005, 1, 1) + 1;


      and after i select them and load the script must execute a sql query like that :

       


      and i.trndate
      between convert(datetime,'$Date_start',103)
      and convert(datetime,'$Date_end',103)


      i receive an error :

      SQL error: Syntax error converting datetime from character string.
      Script line: .... and i.trndate between convert(datetime,'$Date_start',103) and convert(datetime,'$Date_end',103)

       

      any tips ?