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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax i think

Status
Not open for further replies.

oakpark5

Programmer
Sep 2, 2004
81
US
this is my code:

select sum(lonhand) from iciloc where loctid = stock,zbond and item=@item

@item is a parameter i passed. I'm not sure about the syntax but there is a table with where item come up twice. one for loctid=stock and one for loctid=bond. I'm trying to add the two together. Cant seem to get it right. Thanks in advance for any help.

Software Engineer
Team Lead
damn bill gates, he has everything
 
[case]
select sum(lonhand)
from iciloc
where loctid IN ('stock','zbond')
and item=@item
[/case]

good luck


[bandito] [blue]DBomrrsm[/blue] [bandito]
 
almost there.
Code:
select sum(lonhand) 
from iciloc 
where loctid in ('stock','zbond')
     and item=@item
Try that out.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
 
Thanks for the help, i've tried that as well. I'm writing this as a sql string in C#, which is running behind an ASp.NET page. I dont know why but it doesnt seem to like the syntax, this is the error i get: [FormatException: Input string was not in a correct format.]

Not sure if anyone knows the correct format using c# but if ya do, i would appreciate the help, thansk.

Software Engineer
Team Lead
damn bill gates, he has everything
 
Nope, not a C# programmer.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top