Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
irmantas
Contributor III
Contributor III

How load date YYYY-MM

Hello all,

From SQL I am loading  data like this :

Year(INVOICEDATE) as Year,

Month(INVOICEDATE) as Month,

Day(INVOICEDATE) as Day,

But i need load field like this : YYYY-MM

I was try :Year(INVOICEDATE)&'-'& Month(INVOICEDATE) as YearMonth,

But result is 0

Is it posable???

Labels (1)
1 Solution

Accepted Solutions
andrei_delta
Partner - Creator III
Partner - Creator III

hi,

this is the sql command for getting YYYY-MM from current time : convert(varchar(7), getdate(), 126)

View solution in original post

18 Replies
Chanty4u
MVP
MVP

what is the  Invoice date format?

Chanty4u
MVP
MVP

you can try this

Date(monthstart(Date), 'YYYY-MM')  as MonthYear

irmantas
Contributor III
Contributor III
Author

YYYY.MM.DD hh:mm:ss

Chanty4u
MVP
MVP

try

Date(InDate,'YYYY-MM')  as YearMonth

irmantas
Contributor III
Contributor III
Author

I got error:

'Date' is not a recognized built-in function name.

Chanty4u
MVP
MVP

used invoice date only right?

Anil_Babu_Samineni
MVP
MVP

My option is this?

Date(Date#(INVOICEDATE,'YYYY.MM.DD hh:mm:ss'), 'YYYY-MM')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
irmantas
Contributor III
Contributor III
Author

Date(INVOICEDATE,'YYYY-MM')  as YearMonth

irmantas
Contributor III
Contributor III
Author

Error: 'Date#' is not a recognized built-in function name