Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to get the month of a date into a SQL SELECT statement. I want the numeric value, thus 1, 2, ,,,, 11, 12 not the brief month name.
Thanks
Hello,
The Month() function returns a dual value, so with
Num(Month(DateField)) AS MonthNo
You will get the month number.
Hope that helps.
Hello,
The Month() function returns a dual value, so with
Num(Month(DateField)) AS MonthNo
You will get the month number.
Hope that helps.
Hi,
I have tried you solution in SQL select, but it says Num is not a valid funtion, and even I dont write Num, and writing like Month(datefield) as month, it gives month number, but I need month name in Jan, feb, march etc. please help.
Hi Shubham,
The above is meant to be used in a LOAD statement like this:
// QlikView is case sensitive: fields must be spelled as the RDBM/ODBC driver returns them
Data:
LOAD CustomerID,
Num(Month(DateField)) AS NumMonth,
Month(DateField) AS NameMonth,
DateField;
SQL SELECT CustomerID,
DateField
FROM Database.Table;
Hope that helps.
Miguel