Viewing 15 posts - 1,321 through 1,335 (of 1,472 total)
My apologies for all the semi correct attempts, had I taken the time to read all the posts I glossed over from a couple days ago, I'd have seen most...
October 20, 2008 at 2:23 pm
Ok, I just discovered something interesting. The reason it wasn't working before is because the @LastDupe variable inside that CASE statement does not get properly evaluated for the subselect....
October 20, 2008 at 11:54 am
The A's only is a very easy fix. The second part should have been handled by the variable check, but it's not reacting the way I thought it would....
October 20, 2008 at 10:04 am
Ok, so a slight change in logic. How about this one?
[font="Courier New"]
------ Declare Variables ----------------------------------
DECLARE @GroupID INT,
@PrevCode CHAR(5),
@RowID INT,
@LastDupe INT,
@Dupe TinyInt
SET @PrevCode = (SELECT Code FROM #TempTable WHERE RowID = 1)
SET @GroupID =...
October 20, 2008 at 9:24 am
Is this the whole query? If not, please post the rest. At the time of your original question, you didn't specify it was going to be a subquery....
October 20, 2008 at 8:49 am
Select EmpCode
FROM tblEmployees
WHERE EmpCode NOT IN (select EmpCode from tblEmpCodes where cancelled is NOT NULL) (none)
That one there takes subgroup out of the equation.
As Barry said, it means...
October 20, 2008 at 7:43 am
Not really enough information for us to go on at this point.
What rowcounts do these statements return on the database you get nothing from?
SELECT FirstName,LastName,EmpEmail,EmpCode
FROM tblEmployees
SELECT FirstName,LastName,EmpEmail,EmpCode
FROM tblEmployees
WHERE Subgroup =...
October 20, 2008 at 7:16 am
Makes perfect sense, I just thought about it like that. Thanks much for both explanations, that'll close a whole lot of holes on our new website build.
October 19, 2008 at 2:57 pm
K, so we were basically saying the same thing, I misunderstood as it seemed like your post was in response to mine. The code posted was purely for explanation's...
October 19, 2008 at 11:23 am
You aren't taking into account the original requirement that actual months only be used if the Month value exists in his second table. While we all agree it's a...
October 19, 2008 at 10:28 am
I figured as much, which is why I didn't post it with the earlier solution, but then I realized that the next person that reads this thread might have the...
October 19, 2008 at 9:10 am
In ASP for example, you can do:
sql="SELECT * FROM TABLE WHERE Field ='" & MyVariable & "'"
rs.open sql conn2
Instead of
sql ="Exec dbo.MySP @Variable =" & MyVariable
rs.open sql conn2
So she...
October 19, 2008 at 12:19 am
Is it bad practice to hard code the SQL into the front end in cases such as these? I wouldn't do it, but I know a lot of people...
October 18, 2008 at 8:30 pm
SELECT @@VERSION will return the current version of the SQL server it is run against.
That along with an IF by your VB app should cover it. Note...
October 18, 2008 at 7:15 pm
Agreed, and the Month name being entered into an alternate table to signify that real data should be used adds another unnecessary step. Add your projected data to the...
October 18, 2008 at 7:00 pm
Viewing 15 posts - 1,321 through 1,335 (of 1,472 total)