on 03-30-2007 8:29 PM
Hello, I have the following User Query:
SELECT T.USERID As EmpID, OHEM.FIRSTNAME' 'OHEM.LASTNAME, OHEM.U_RATE AS GeneralRate, T.CARDCODE As CardCode, T.CARDNAME As CardName, SUM(ISNULL(T.APPROVED_HOURS,0)*ISNULL(T.RATE,0)) As BilledAmount, T.GENCHECK AS CheckNumber, OVPM.[CheckSum], OVPM.DOCDATE
FROM SCCG_WB_TIME AS T LEFT JOIN OHEM ON OHEM.EMPID=T.USERID LEFT JOIN OVPM ON T.GENCHECK = OVPM.DOCNUM
WHERE ISNULL(T.GENCHECK, 0)<>0 AND <b>T.USERID =[%0]</b>
GROUP BY T.USERID, OHEM.FIRSTNAME' 'OHEM.LASTNAME, OHEM.U_RATE, T.CARDCODE, T.CARDNAME, T.GENCHECK, OVPM.[CheckSum], OVPM.DOCDATE
I get an error because of the variable I have. When I press Execute I just get '' (SEWSY) error message in red. Without the variable is working fine. Please help me!
Thank you,
Irina
Hi Irinca,
I think (can't test it) the problem is the not-system-nor-usertable-but-yours table created in SBO that you're passing the variable (SCCG_WB_TIME, just in case).
Try something like,
DECLARE @UserId int
SET @UserId = (SELECT TOP 1 T0.INTERNAL_K FROM [dbo].[OUSR] T0 WHERE T0.U_NAME = '[%0]')
...(your query....)... T.USERID = @UserId...
HTH,
Ian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.