Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a QVD where it will have all months but i always i want to take latest month data from that QVD.
Month Format : 201802
FROM
(qvd)
where Month=Max(Month);
i used above condition but it always fails, can some one guide me how can i give where clause condition.
Best Regards,
Hk
use as
Temp:
Load Month(Max(Date(Date#(Date_Field,'YYYYMM')))) as Max_Month_Date
Resident your_table_name;
1 way :
Load *
Resident Your_Table_name
where Exists (Month(Date_Field,Max_Month_Date);
Drop Table Temp;
2 way :
Load Month(Max(Date(Date#(Date_Field,'YYYYMM')))) as Max_Month_Date
Resident your_table_name;
Let vMaxMonth=Peek('Max_Month_Date',0,'Temp');
Load *
Resident Your_Table_name
where Month(Date_Field)='$(vMaxMonth)';
Thanks
CY
Try
Month=Date(Max(Month),'YYYYMM')
The best way to do this is by using Max() function:
Load:
Max(Month) as Month
FROM
use as
Temp:
Load Month(Max(Date(Date#(Date_Field,'YYYYMM')))) as Max_Month_Date
Resident your_table_name;
1 way :
Load *
Resident Your_Table_name
where Exists (Month(Date_Field,Max_Month_Date);
Drop Table Temp;
2 way :
Load Month(Max(Date(Date#(Date_Field,'YYYYMM')))) as Max_Month_Date
Resident your_table_name;
Let vMaxMonth=Peek('Max_Month_Date',0,'Temp');
Load *
Resident Your_Table_name
where Month(Date_Field)='$(vMaxMonth)';
Thanks
CY