I would like to pass a parameter to a stored procedure thats used in a like condition of the where clause.
Example:
Select all customer that start with "A"
Declare @Cust_no as char(4)
Select *
from customer
where customer_number like @Cust_no
Not having any luck with this. I have...
I found this and it seems to do the job.
'Declarations
Private Declare Function SQLAllocEnv Lib "odbc32.dll" _
(phenv As Long) As Integer
Private Declare Function SQLDataSources Lib "odbc32.dll" _
(ByVal hEnv As Long, ByVal fDirection As Integer, _
ByVal szDSN$, ByVal...
I am using SQL Server 7.0.
I have a couple of queries that perform very different from the SQL Analyzer vs. Application GUI.
I have a query that accepts four parameters.
@date as datetime
@Qual_no char(2)
@Patt_no char(2)
@Sku_no as char(16)
select qualcode,pattcode,orderdate,qtyordered,sku...
I'm using SQL Server 7.0 and would like to use a
parameter for a table column name in a "SUM" aggregation.
Code:
Select
sum(case when Fweek=@Curweek-8 then (quantity*Dollars) else 0 end) 'Week-8'
from ....
Can the (Quantity*Dollars) expression be passed as a parameter? I have...
I have a table that keeps sales by day.
I want to return the results in column fashion. Similar to Cross-Tab.
Example
Select sum(Sales on Mondays), sum(Sales on Tuesdays), ...
where date between ( xxxx) and (xxxx)
Any suggestions most appreciated.
TIA
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.