Consider these two tables. I use persian dates, so I have to declare startdate
and enddate
as a string(nvarchar(10)
).
crt table:
id title startdate enddate
--------------------------
1 xyz 1395/01/01 1395/12/29
2 xyy 1394/12/01 1395/05/05
3 cvb 1392/02/03 1394/02/03
season table:
id title startdate enddate
--------------------------
1 spring95 1395/01/01 1395/03/31
I want to write a query that gives me crt records that are valid in a season. IE crt.startdate<=season.startdate and crt.enddate>=season.enddate
.
How do I do that?