Link to home
Start Free TrialLog in
Avatar of SQLSearcher
SQLSearcher

asked on

SSRS Lookup to match Oracle date with SQL Server Date

Hello Experts Exchange
I have a SQL Server Reporting Services Report that queries Oracle and SQL Server.  The report is for a site for two weeks worth of data.

It has the date in a table on the left hands side, which is from Oracle.

This is my date query for Oracle.

select to_date(:RW_Start_Date,'DD/MM/YYYY') + level - 1 as Date1 
from dual
connect by level <= to_date(:RW_End_Date,'DD/MM/YYYY') - to_date(:RW_Start_Date,'DD/MM/YYYY') + 1

Open in new window


I then have a list of queries on Oracle based on the dates.

I am now towards the end of my report and the last two fields of data are in SQL Server.

Here is the query for SQL Server;

Select Cast(convert(varchar, sodDate, 101) as date) as Till_Date,sodDate
From [Bank_Activity_Opening_Time]
Where Branch = Right(@Loc_Loc_Code,3)
and sodDate >= @RW_Start_Date
and sodDate <= @RW_End_Date

Open in new window


I am using a Lookup in my SSRS table to match the dates up and display the data.

This is my Lookup expression in SSRS.

=LookupSet(FormatDateTime(Fields!DATE1.Value, DateFormat.ShortDate),FormatDateTime(Fields!Till_Date.Value, DateFormat.ShortDate),Fields!sodDate.Value, "Open_Time")

Open in new window


However no matter the date format that I try I can not get the data to display in my table.

Does anyone have any suggestions that I can try to get the dates to matches and that the data will display in my table?

Regards

SQLSearcher
SOLUTION
Avatar of bcnagel
bcnagel
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Arifhusen Ansari
Arifhusen Ansari
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SQLSearcher
SQLSearcher

ASKER

Thank you for your help.