Simple: Help with a statment 
Author Message
 Simple: Help with a statment
Hi

I need to check the date of a records in a row when doing a select statement
and if the date if greater than the current date mark a field as True.

ie

Select Title, ReleaseDate
//logic to go here to test if
//ReleaseDate is greater the GetDate()
//and mark a field return a field "Forthcoming" as "T"
From Products
Order By Title

Hope this is clear.

Thanks

Sam



Sat, 28 Feb 2004 18:08:20 GMT
 Simple: Help with a statment

Check out the CASE expression

ReleaseDate = CASE WHEN field > value THEN value
                                   WHEN ...
                                    ELSE value
                        END

--
Tony Rogerson SQL Server MVP
Torver Computer Consultants Ltd
http://www.sql-server.co.uk


Quote:
> Hi

> I need to check the date of a records in a row when doing a select
statement
> and if the date if greater than the current date mark a field as True.

> ie

> Select Title, ReleaseDate
> //logic to go here to test if
> //ReleaseDate is greater the GetDate()
> //and mark a field return a field "Forthcoming" as "T"
> From Products
> Order By Title

> Hope this is clear.

> Thanks

> Sam



Sat, 28 Feb 2004 18:08:08 GMT
 Simple: Help with a statment
Sorted.

Thanks,

Sam


Quote:
> Check out the CASE expression

> ReleaseDate = CASE WHEN field > value THEN value
>                                    WHEN ...
>                                     ELSE value
>                         END

> --
> Tony Rogerson SQL Server MVP
> Torver Computer Consultants Ltd
> http://www.sql-server.co.uk



> > Hi

> > I need to check the date of a records in a row when doing a select
> statement
> > and if the date if greater than the current date mark a field as True.

> > ie

> > Select Title, ReleaseDate
> > //logic to go here to test if
> > //ReleaseDate is greater the GetDate()
> > //and mark a field return a field "Forthcoming" as "T"
> > From Products
> > Order By Title

> > Hope this is clear.

> > Thanks

> > Sam



Sat, 28 Feb 2004 21:31:12 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Simple Select Statment help

2. Need help with sql statment in an odbc statment

3. Can I use case statments with in where statment

4. Help on simple simple stored procedure

5. HELP! simple question need simple answer

6. SQL Statment Within a Cursor. Please help

7. SQL Statment Help

8. Some help in backup/restore statments

9. SQL7, SIMPLE SIMPLE SIMPLE question

10. Help with SQL Statment

11. HELP with SQL Statment

12. SQL Statment Help....


 
Powered by phpBB® Forum Software