All Forums Analytics
jat_kkp 1 post Joined 06/06
16 Jun 2006
Comparing Date with Decimal Column

Gurus, I have a scenario where I need to figure out if the given data falls between the two dates.These two dates are two columns in which are datatype as Decimal(6,0).So my query according to requirement is something like this:SELECT * from abc where columna='abc' AND '04/06/06'(date,format 'mm/dd/yy') Between col1 And col2.Note: '04/06/06'(date,format 'mm/dd/yy') is the variable being passed.Col1 and col2: These are columns which are of decimal type(6,0) but they have dates as values.Thanks for reading and if possible, please suggest me something.

csb 2 posts Joined 05/05
22 Jun 2006

Try this.sel * from tablenamewhere columna = 'bcd'and '03/01/06' between cast(col1 as date format 'mm/dd/yy') and cast(col2 as date format 'mm/dd/yy') ;

You must sign in to leave a comment.