- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DateDiff function to load data
Dear All,
We are using MSSQL as our data source, we could connect to the SQL server from QV.
We are now trying to load our data from the SQL server. we are using the following query in the Edit script to load data for the next 90 days, however we are getting error while we reload the script.:
SNAPSHOT:
LOAD snapshotdate,
potentialid,
amount,
closingdate,
Ceil(Month(closingdate)/3) as Quarter,
"sales_stage" AS snap_salesstage;
SQL SELECT * FROM "vtiger_crm".dbo.snapshot
//where (closingdate-snapshotdate <=90) and (closingdate>=snapshotdate);
where DATEDIFF(DD,snapshotdate,<=90) and (closingdate>=snapshotdate);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
What kind of Error?
Can you send us the Error?
BR
Ariel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
in qlikview write this
simply write your where condition with load statement
SNAPSHOT:
LOAD snapshotdate,
potentialid,
amount,
closingdate,
Ceil(Month(closingdate)/3) as Quarter,
"sales_stage" AS snap_salesstage
//where (closingdate-snapshotdate <=90) and (closingdate>=snapshotdate);
where DATEDIFF(DD,snapshotdate,<=90) and (closingdate>=snapshotdate);
SQL SELECT * FROM "vtiger_crm".dbo.snapshot ;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We tired the above resolution and we are getting the following error:
Error in expression:
DATEDIFF is not a valid function
SNAPSHOT:
LOAD snapshotdate,
potentialid,
amount,
closingdate,
Ceil(Month(closingdate)/3) as Quarter,
"sales_stage" AS snap_salesstage
where DATEDIFF(DD,snapshotdate,closingdate)<=90