Re: Select statement
From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 06/18/04
- Next message: prv: "Re: Create view limitation"
- Previous message: Random: "Re: Create view limitation"
- In reply to: D Mack: "RE: Select statement"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 18 Jun 2004 22:47:50 +0200
On Fri, 18 Jun 2004 09:30:01 -0700, D Mack wrote:
>What a dunce! The statement below does work. This is what doesn't:
>
>select (convert(char(10), ae_p_wka_e.sched_date, 101)) = (convert(char(10), getdate() - 2, 101)) from ae_p_wka_e
>
>I'm trying to narrow down the choice of records before I do anything else with them.
>
>Thanks.
Hi D,
I'm not entirely sure what you would want this statement to do. Are you
trying to get a true/false result for each row? If so, try:
SELECT CASE
WHEN ae_p_wka_e.sched_date IS NULL
THEN 'Unknown'
WHEN convert(char(10), ae_p_wka_e.sched_date, 101) =
convert(char(10), getdate() - 2, 101)
THEN 'True'
ELSE 'False'
END
FROM ae_p_wka_e
If this is not what you want, please post:
* DDL (CREATE TABLE statements, including all constraints)
* Sample data (as INSERT statements)
* Expected output
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)
- Next message: prv: "Re: Create view limitation"
- Previous message: Random: "Re: Create view limitation"
- In reply to: D Mack: "RE: Select statement"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|