Re: Date query problem!
From: MGFoster (me_at_privacy.com)
Date: 02/25/05
- Next message: MGFoster: "Re: Want to Call DTS Package...."
- Previous message: Tibor Karaszi: "Re: Differences between TSQL and SQL-92"
- In reply to: news.wanadoo.nl: "Date query problem!"
- Next in thread: news.wanadoo.nl: "Re: Date query problem!"
- Reply: news.wanadoo.nl: "Re: Date query problem!"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 25 Feb 2005 20:51:35 GMT
news.wanadoo.nl wrote:
> Hi,
>
> I've a problem with making a query. I need to get out a result where a date
> for example 25-02-05 is in a table.
> The problem is that the dates in the table are old like 25-02-03. So is
> there a sollution where I only need the day and month to get the result?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
By "old" do you mean the dates are stored as strings in the format "25
02-03," or, do you mean the dates are in the past, in the year 2003,
instead of the year 2005?
Assuming (a lot) that the dates are stored as DateTime data types:
SELECT *
FROM table_name
WHERE date_column = '20050225'
Normally, a query's WHERE clause filters which records are selected from
a table. Read the Books On Line (BOL) articles on the WHERE clause.
-- MGFoster:::mgf00 <at> earthlink <decimal-point> net Oakland, CA (USA) -----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv iQA/AwUBQh+P24echKqOuFEgEQLt9gCeOV3ZFXBu+JApCbMNi+I5rS4w104AoMBB kpwTK1OPe8MZP/XAsyfoSRDb =KstK -----END PGP SIGNATURE-----
- Next message: MGFoster: "Re: Want to Call DTS Package...."
- Previous message: Tibor Karaszi: "Re: Differences between TSQL and SQL-92"
- In reply to: news.wanadoo.nl: "Date query problem!"
- Next in thread: news.wanadoo.nl: "Re: Date query problem!"
- Reply: news.wanadoo.nl: "Re: Date query problem!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|