Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
swati_rastogi27
Creator
Creator

Sorting Date in MMM-YYYY format in script

Hi All ,

Here is the list of Month Year values i have in my QVD:

Dec-2016

Jan-2017

Feb-2017

Mar-2017

Apr-2017

May-2017

Jun-2017

Jul-2017

Aug-2017

Sep-2017

Oct-2017

Nov-2017

Dec-2017

Jan-2018

For Incremental Load , i want to fetch data which is less than Jan-2018 and then concatenate recent data to it

I am using the statement :

Select <>

from <QVD>

where DATE_MONTH < date(MonthStart('Jan-2018'), 'MMM-YYYY')

so using this i don't get anything.

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hi Swati,

Select <>

From <QVD>

Where DATE_MONTH < Date(Date#('Jan-2018','MMM-YYYY'),'MMM-YYYY');

View solution in original post

3 Replies
gerry_hdm
Creator II
Creator II

Hello

Format  the var in 'mm.yyyy'

gruß Gerold

anagharao
Creator II
Creator II

Try:

Select <>

from <QVD>

where date(DATE_MONTH,'MMM-YYYY') < date(MonthStart('Jan-2018'), 'MMM-YYYY')

Note: if the DATE_MONTH is a predetermined format define that using DATE# function

tamilarasu
Champion
Champion

Hi Swati,

Select <>

From <QVD>

Where DATE_MONTH < Date(Date#('Jan-2018','MMM-YYYY'),'MMM-YYYY');