Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello. I am trying to re-write a SQL statement from Access into QlikView. A portion of the Access SQL statement uses the DateSerial function. I know that QlikView does not use this same function, so how do I get QlikView to do the same thing? Thank you.
Original code:
Hi,
To create dates from different fields or expressions, use the MakeDate() function. Your expression should be like
If(Min(PSNUM2)<>0, MakeDate(Left(Min(PSNUM2), 4), Mid(Min(PSNUM2), 5, 2), Right(Min(PSNUM2), 2)), 0) AS START_SHIP_DATE
or even easier, if the input format is always the same:
Date(Date#(PSNUM2, 'YYYYMMDD')) AS START_SHIP_SATE
Hope that helps.
Miguel
Thanks so much for helping me with this Miguel. One question, though. Why did you insert the Min keyword in different places? Does it have to be there? Thanks.
Hi,
I was just copying and pasting from your example line, I was trying to show how the MakeDate() function works. Min() does not have to be there if you don't need it.
Miguel
Ok. I understand. Thank you so much for your help ☺