Viewing 15 posts - 3,076 through 3,090 (of 4,085 total)
Dave C. (8/20/2012)
are there any other ways of accomplishing this?
Why do you ask? Is there something wrong with the proposed solution, such as your neglecting to tell us that...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 20, 2012 at 11:34 am
Try the following:
SELECT ord_oda_id, token, ISNULL(ord_id, 5000) AS ord_id
FROM xx_pm_receipts
OUTER APPLY (
SELECT TOP (1) ord_id + 1 AS ord_id
FROM xx_ordid_tracker
WHERE poid = ord_oda_id
ORDER BY ord_id DESC ) AS ot
WHERE token...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 20, 2012 at 8:37 am
If you're trying to do what I think you are, then the answer is that you can't do it in SQL. First Normal Form for databases is that all...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 14, 2012 at 8:14 am
GSquared (8/13/2012)
CTEs don't start with a semicolon.
I disagree. While I'm sure that the intention is that the statement before must end with a semicolon, implementation and general practice clearly...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 13, 2012 at 3:18 pm
STOP!!!! You're opening yourself up to a very serious security risk. Identity theft is a very big problem and the primary source is SSNs from hacked databases.
You should...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 10, 2012 at 7:15 am
Scott D. Jacobson (8/7/2012)
You should NEVER use BETWEEN with datetime data.
Do you have any more material on this or is it purely anecdotal? For instance, what's wrong with this?
The issue...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 7, 2012 at 12:11 pm
Try NTILE().
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 7, 2012 at 11:35 am
You should NEVER use BETWEEN with datetime data. Your query assumes a precision of 1 second when the actual precision of datetime data is 3 milliseconds, so you are...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 7, 2012 at 8:48 am
CELKO (8/7/2012)
It looks like you use assembly language bit flays
Until SQL support Boolean datatypes, bit flags are the next best thing.
, but you did not bother to post any DDL...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 7, 2012 at 7:53 am
I think that we would all agree that the following strings should all produce the same results when converted to an integer:
' 1'
'01'
So, it makes sense to me, that if...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 7, 2012 at 7:33 am
Note that "b.date_deactivated is not NULL" is superfluous. If b.date_deactivated is NULL then the result of "b.date_deactivated < '7 aug 2012'" will also be NULL. So, in order...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 7, 2012 at 7:12 am
As Joe alluded to, there is a much simpler method of calculating intersections. The standard uses only two dates, but it easily be modified to account for multiple dates.
SELECT...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 3, 2012 at 8:18 am
Without data, it's hard to say what the best approach is, but consider using CROSS APPLY instead of the CURSOR. Here's something that will help get you started.
SELECT EvaluateeEvaluationID,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 3, 2012 at 7:08 am
kaushal_shah26 (8/2/2012)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 2, 2012 at 9:18 am
kaushal_shah26 (8/2/2012)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 2, 2012 at 7:20 am
Viewing 15 posts - 3,076 through 3,090 (of 4,085 total)