please let it be the parantheses in the wrong place!
I have a table called aropen. In it is a field called duedt. All I want to do is pull every record where duedt is greater than 120 from today.
duedt [decimal[8,0], Not Null]
I try:
SELECT * FROM dbo.AROPEN Where CONVERT(decimal(8), GetDate(), 112) - CONVERT(decimal(8), duedt, 112) > 120
Unfortunately, this only brings up ten junk records where the value of the field wasn't set to a date somehow and is a 0.
Flailing about I try:
SELECT * FROM dbo.AROPEN Where Cast(CONVERT(decimal(8), GetDate(), 112) as dateTime) - Cast(CONVERT(decimal(8), duedt, 112) as dateTime) > 120
but then get an error message:
Server: Msg 8115, Level 16, State 2, Line 3
Arithmetic overflow error converting expression to data type datetime.
I also tried DATEDIFF with no results.
Thanks In Advance for any help. I couldn't find any in that bol or google.
I have a table called aropen. In it is a field called duedt. All I want to do is pull every record where duedt is greater than 120 from today.
duedt [decimal[8,0], Not Null]
I try:
SELECT * FROM dbo.AROPEN Where CONVERT(decimal(8), GetDate(), 112) - CONVERT(decimal(8), duedt, 112) > 120
Unfortunately, this only brings up ten junk records where the value of the field wasn't set to a date somehow and is a 0.
Flailing about I try:
SELECT * FROM dbo.AROPEN Where Cast(CONVERT(decimal(8), GetDate(), 112) as dateTime) - Cast(CONVERT(decimal(8), duedt, 112) as dateTime) > 120
but then get an error message:
Server: Msg 8115, Level 16, State 2, Line 3
Arithmetic overflow error converting expression to data type datetime.
I also tried DATEDIFF with no results.
Thanks In Advance for any help. I couldn't find any in that bol or google.