Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SUM CASE DATE Problem

Status
Not open for further replies.

KOVMoe

Programmer
Jun 30, 2004
34
US
when I use the Sum case on a date field I get an error, cannot convert nvarchar to int. Here is the code.

SUM(CASE WHEN d.dat_val_dt = '2005-08-03' THEN 1 ELSE 0 END)AS TOTSPH

Any ideas?


Thank you,

[king]Moe-King of the Village Idiots.

"When in trouble,
when in doubt;
Run in circles-
SCREAM & SHOUT!!"
Burma Shave
 
This is not complete query... FROM what?
And what is datatype for dat_val_dt column?

------
[small]select stuff(stuff(replicate('<P> <B> ', 14), 109, 0, '<.'), 112, 0, '/')[/small]
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top