Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 7790

IDT Join using BETWEEN for date fields

$
0
0

Tool: Information Design Tool, BO4.0 SP5 P6

Hi,

I have 2 tables (SQL server) which I want to join using a join criterion that involves BETWEEN. One of them is a derived table and the field used is a date field stored as VARCHAR - YYYYMMDD. I tried all approaches like converting both of them into numeric and date formats and use a join criterion like

table1.date BETWEEN table2.fromdate AND table2.todate. But I am seeing multiple rows instead of one matching record which I should be seeing here.

(Cartesian product or Trap?) But something like table1.date = table2.fromdate works fine. And table1.date <= table2.fromdate AND table1.date >= table2.todate also results similar to BETWEEN. Any thoughts for this issue please?

 

Thanks,

Anil


Viewing all articles
Browse latest Browse all 7790

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>