Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey,
I'm trying to retrieve data, limiting it in SQL according to Today’s date.
The problem is that the date is stored in YYYYMMDD format, therefore not in proper SQL format
Things like
WHERE Date = GetDate()
Or
DATEADD(day, 0, CURRENT_TIMESTAMP);
Or
WHERE Date = CONVERT(CHAR(10),GETDATE(),112);
WHERE Date = CONVERT(VARCHAR(8), GETDATE(), 112) AS [YYYYMMDD]
If (to avoid confusion) we now define the field I need to look in for today’s date as MyField, how would the script look like?
Load *;
SQL SELECT
Field1, Field2, MyField from Server.table WHERE MyField = (?);
Thank you!
date# equivalent function in sql wud solve my query..i guess
thanks
Yep - and there is the QV equivalent. Have you looked in the F1 help?
LET vToday = Date(Today(),'DD-MMM-YY');
LOAD.....
WHERE Date(Date#(MyField,'DD-MMM-YY'),'DD-MMM-YY') = '$(vToday)';
hi jason,
i am fetching data from SAP which uses SQl selectstatement before load hence i need sql function to change the data in date format.
eg:
a100:
load
myfield,
z_z4;
sql select myfield z_z4 from table1;
script looks something like this .. so what should be my where statement after table1??
date# wont work because it's not a sql function
thanks for concern
sudeep