Click here to Skip to main content
15,886,362 members
Home / Discussions / Database
   

Database

 
AnswerRe: How do I retrieve the manipulated blob? Pin
Richard MacCutchan6-Apr-23 6:08
mveRichard MacCutchan6-Apr-23 6:08 
QuestionTSQL, Order by case, and I need to order by version Pin
jkirkerx21-Mar-23 8:09
professionaljkirkerx21-Mar-23 8:09 
AnswerRe: TSQL, Order by case, and I need to order by version Pin
Ron Nicholson21-Mar-23 8:22
professionalRon Nicholson21-Mar-23 8:22 
GeneralRe: TSQL, Order by case, and I need to order by version, [fixed] good enough for me, thanks Pin
jkirkerx21-Mar-23 8:36
professionaljkirkerx21-Mar-23 8:36 
GeneralRe: TSQL, Order by case, and I need to order by version, [fixed] good enough for me, thanks Pin
Mycroft Holmes21-Mar-23 12:23
professionalMycroft Holmes21-Mar-23 12:23 
GeneralRe: TSQL, Order by case, and I need to order by version, [fixed] good enough for me, thanks Pin
jkirkerx21-Mar-23 13:17
professionaljkirkerx21-Mar-23 13:17 
GeneralRe: TSQL, Order by case, and I need to order by version, [fixed] good enough for me, thanks Pin
jsc4222-Mar-23 0:17
professionaljsc4222-Mar-23 0:17 
GeneralRe: TSQL, Order by case, and I need to order by version, [fixed] good enough for me, thanks Pin
jkirkerx22-Mar-23 6:42
professionaljkirkerx22-Mar-23 6:42 
GeneralRe: TSQL, Order by case, and I need to order by version Pin
jkirkerx21-Mar-23 8:46
professionaljkirkerx21-Mar-23 8:46 
GeneralRe: TSQL, Order by case, and I need to order by version Pin
Ron Nicholson21-Mar-23 11:17
professionalRon Nicholson21-Mar-23 11:17 
AnswerRe: TSQL, Order by case, and I need to order by version Pin
jschell23-Mar-23 6:26
jschell23-Mar-23 6:26 
GeneralRe: TSQL, Order by case, and I need to order by version Pin
jkirkerx23-Mar-23 9:03
professionaljkirkerx23-Mar-23 9:03 
QuestionSQL where clause variability up against coding standards Pin
Brian L Hughes10-Mar-23 15:59
Brian L Hughes10-Mar-23 15:59 
AnswerRe: SQL where clause variability up against coding standards Pin
Dave Kreskowiak11-Mar-23 5:37
mveDave Kreskowiak11-Mar-23 5:37 
AnswerRe: SQL where clause variability up against coding standards Pin
Eddy Vluggen11-Mar-23 9:00
professionalEddy Vluggen11-Mar-23 9:00 
AnswerRe: SQL where clause variability up against coding standards Pin
jschell13-Mar-23 6:56
jschell13-Mar-23 6:56 
AnswerRe: SQL where clause variability up against coding standards Pin
jsc4223-Mar-23 7:32
professionaljsc4223-Mar-23 7:32 
Brian L Hughes wrote:
SELECT * FROM people
WHERE
( @nameactive = 1 AND name like @nameparam )
OR
( @dobActive = 1 AND dob = @dobParam)
Well it seemed to work but failed to narrow down to a specific row. Hypothetically if fnameparam were george and dobparam was 2010/2/30 it would return all georges and all people who were born on feb 30th, so no, it should return no rows if there are no georges born on feb 30th. Yes, by George I am joking about feb 30th.

So, you want to only have Georges born on the 30th Feb? If so, why no use De Morgan's laws - Wikipedia[^] and reverse your tests e.g.
SQL
SELECT * FROM people
      ...
WHERE (@nameactive = 0 OR name like @nameparam)
   AND  (@dobactive = 0 OR dob = @dobparam)

This should just treat unwanted criteria as true and just AND wanted criteria.
GeneralRe: SQL where clause variability up against coding standards Pin
Brian L Hughes23-Mar-23 14:52
Brian L Hughes23-Mar-23 14:52 
GeneralRe: SQL where clause variability up against coding standards Pin
jsc4227-Mar-23 23:00
professionaljsc4227-Mar-23 23:00 
GeneralRe: SQL where clause variability up against coding standards Pin
jschell28-Mar-23 6:23
jschell28-Mar-23 6:23 
QuestionCode: 1292 SQL State: 22007 --- Incorrect datetime value Pin
Siavash.BRY6-Mar-23 20:56
Siavash.BRY6-Mar-23 20:56 
AnswerRe: Code: 1292 SQL State: 22007 --- Incorrect datetime value Pin
Richard MacCutchan6-Mar-23 21:26
mveRichard MacCutchan6-Mar-23 21:26 
GeneralRe: Code: 1292 SQL State: 22007 --- Incorrect datetime value Pin
Siavash.BRY6-Mar-23 21:52
Siavash.BRY6-Mar-23 21:52 
GeneralRe: Code: 1292 SQL State: 22007 --- Incorrect datetime value PinPopular
Richard MacCutchan6-Mar-23 22:09
mveRichard MacCutchan6-Mar-23 22:09 
AnswerRe: Code: 1292 SQL State: 22007 --- Incorrect datetime value Pin
jschell8-Mar-23 7:03
jschell8-Mar-23 7:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.