|
-
Mar 15th, 2003, 01:33 AM
#1
Thread Starter
Fanatic Member
Another sql statement problem
Hi Everyone,
What is wrong with this sql statement? I keep getting an error saying that there is an incorrect syntax near the '=' sign. I would appreciate any help. Thank you.
Code:
SELECT MemID, MemName, (CASE WHEN PayCredit = AppRes THEN PayCredit = NULL
ELSE PayCredit - AppRes END) AS AppliedCredit, (CASE WHEN AppRes = 0 THEN AppRes = NULL
ELSE AppRes END) AS CreditReserve
FROM Archive
WHERE PDate BETWEEN CAST('" & DTPicker1.Value & "' AS smalldatetime) AND CAST('" & DTPicker2.Value & "' AS smalldatetime) AND
PayCredit <> 0 AND PayCredit <> DedRes
ORDER BY ID
-
Mar 15th, 2003, 03:36 AM
#2
Fanatic Member
Re: Another sql statement problem
Originally posted by Ace
Hi Everyone,
What is wrong with this sql statement? I keep getting an error saying that there is an incorrect syntax near the '=' sign. I would appreciate any help. Thank you.
Code:
SELECT MemID, MemName, (CASE WHEN PayCredit = AppRes THEN PayCredit = NULL
ELSE PayCredit - AppRes END) AS AppliedCredit, (CASE WHEN AppRes = 0 THEN AppRes = NULL
ELSE AppRes END) AS CreditReserve
FROM Archive
WHERE PDate BETWEEN CAST('" & DTPicker1.Value & "' AS smalldatetime) AND CAST('" & DTPicker2.Value & "' AS smalldatetime) AND
PayCredit <> 0 AND PayCredit <> DedRes
ORDER BY ID
is ur paycredit a numeric ... if so it cannot accept null. it shd be 0
try changing the null to 0
-
Mar 24th, 2003, 03:26 PM
#3
Member
you cannot use in SQL. You must use hope that helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|