Re: Date query problem!

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: MGFoster (me_at_privacy.com)
Date: 02/25/05


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-----


Relevant Pages

  • Help Criteria in Query
    ... I want to double Click on a field in my form and open a query and the where ... clause filters the data and only shows me the records that match. ... Private Sub Name_DblClick ... Dim StDocName As String ...
    (microsoft.public.access.queries)
  • The server sent an unrecognizable response.
    ... I have an mdx query that works fine most of the time. ... clause filters over a certain date range the query errors with: ... Executing the query ... ...
    (microsoft.public.sqlserver.olap)