Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-access > #14363

Re: Need some SQL

From Ron Weiner <rw@domain.com>
Newsgroups comp.databases.ms-access
Subject Re: Need some SQL
Date 2021-08-15 12:03 -0400
Organization WorksRite
Message-ID <sfbdth$1kd$1@dont-email.me> (permalink)
References (6 earlier) <XnsAD8719D7DAADammammatatiscalineti@127.0.0.1> <8037f4fc-dfdb-4d7d-8858-371740811704n@googlegroups.com> <sfb4nj$f2v$1@dont-email.me> <sfb9r9$hlb$1@dont-email.me> <sfbb72$9al$1@dont-email.me>

Show all headers | View raw


It happens that Neil formulated :
> On 8/15/2021 10:54 AM, Neil wrote:
>> If I understand it, the year is not a factor, just the day and month. If 
>> so, the search could be structured:
>> 
>> WHERE Day >= 7 AND Month >= 11 AND Day <= 14 AND Month <= 1*
>> 
>> *This allows for Month <= 3, etc.
>> 
>> Neil
>> 
> OOPS! Wrote this before finishing my coffee!
>
> The structure should be:
> WHERE Day >= 7 AND Month >= 11 OR Day <= 14 AND Month <= 1*
>
> --
> best regards,
>
> Neil

Sorry Neil, I am afraid you are going to need more coffee. The 
following Sql (I believe) uses the Where Clause you suggested.

SELECT RegDate, VIN
FROM tblVehicle
WHERE (((Month([regdate]))>=11) AND ((Day([regDate]))>=7))
OR (((Month([regdate]))<=1) AND ((Day([regDate]))<=14));

Returns:

RegDate	    VIN
11/8/2001	235
12/12/2001	321
12/21/2019	665
1/12/2011	215

The expected result is:

RegDate	    VIN
11/8/2001	235
12/3/2017	332
12/12/2001	321
12/21/2019	665
1/12/2011	215

Rdub

Back to comp.databases.ms-access | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Need some SQL Keith Tizzard <internet.shopping@foobox.com> - 2021-08-12 04:27 -0700
  Re: Need some SQL Ammammata <ammammata@tiscalinet.it> - 2021-08-12 13:11 +0000
    Re: Need some SQL Ammammata <ammammata@tiscalinet.it> - 2021-08-12 13:12 +0000
  Re: Need some SQL Ron Paii <ron81pai@gmail.com> - 2021-08-12 08:11 -0700
    Re: Need some SQL Ron Paii <ron81pai@gmail.com> - 2021-08-12 08:13 -0700
      Re: Need some SQL Keith Tizzard <internet.shopping@foobox.com> - 2021-08-12 08:20 -0700
        Re: Need some SQL Ron Paii <ron81pai@gmail.com> - 2021-08-12 10:37 -0700
          Re: Need some SQL Keith Tizzard <internet.shopping@foobox.com> - 2021-08-12 10:48 -0700
            Re: Need some SQL Ron Paii <ron81pai@gmail.com> - 2021-08-12 11:55 -0700
              Re: Need some SQL Keith Tizzard <internet.shopping@foobox.com> - 2021-08-12 14:05 -0700
                Re: Need some SQL Neil <neil@myplaceofwork.com> - 2021-08-13 11:41 -0400
  Re: Need some SQL Ron Weiner <rw@domain.com> - 2021-08-13 12:50 -0400
    Re: Need some SQL Keith Tizzard <internet.shopping@foobox.com> - 2021-08-14 03:40 -0700
      Re: Need some SQL Ron Weiner <rw@domain.com> - 2021-08-14 10:36 -0400
        Re: Need some SQL Keith Tizzard <internet.shopping@foobox.com> - 2021-08-14 09:17 -0700
          Re: Need some SQL Ron Weiner <rw@domain.com> - 2021-08-14 12:28 -0400
          Re: Need some SQL Ron Weiner <rw@domain.com> - 2021-08-14 12:31 -0400
            Re: Need some SQL Ammammata <ammammata@tiscalinet.it> - 2021-08-14 22:09 +0000
              Re: Need some SQL Keith Tizzard <internet.shopping@foobox.com> - 2021-08-15 03:30 -0700
                Re: Need some SQL "mal....@gmail.com" <mal.reeve@gmail.com> - 2021-08-15 04:54 -0700
                Re: Need some SQL Ron Weiner <rw@domain.com> - 2021-08-15 09:27 -0400
                Re: Need some SQL Neil <neil@myplaceofwork.com> - 2021-08-15 10:54 -0400
                Re: Need some SQL Neil <neil@myplaceofwork.com> - 2021-08-15 11:17 -0400
                Re: Need some SQL Ron Weiner <rw@domain.com> - 2021-08-15 12:03 -0400
                Re: Need some SQL Neil <neil@myplaceofwork.com> - 2021-08-15 13:04 -0400
                Re: Need some SQL Ron Weiner <rw@domain.com> - 2021-08-15 13:23 -0400
                Re: Need some SQL Neil <neil@myplaceofwork.com> - 2021-08-15 16:56 -0400
                Re: Need some SQL Ron Weiner <rw@domain.com> - 2021-08-15 17:13 -0400
                Re: Need some SQL Neil <neil@myplaceofwork.com> - 2021-08-16 13:11 -0400
                Re: Need some SQL Keith Tizzard <internet.shopping@foobox.com> - 2021-08-16 11:16 -0700
                Re: Need some SQL Neil <neil@myplaceofwork.com> - 2021-08-16 15:05 -0400
                Re: Need some SQL Neil <neil@myplaceofwork.com> - 2021-08-16 15:46 -0400
                Re: Need some SQL Keith Tizzard <internet.shopping@foobox.com> - 2021-08-16 14:51 -0700
                Re: Need some SQL Neil <neil@myplaceofwork.com> - 2021-08-16 20:11 -0400
                Re: Need some SQL Neil <neil@myplaceofwork.com> - 2021-08-16 21:54 -0400
                Re: Need some SQL Neil <neil@myplaceofwork.com> - 2021-08-17 02:50 -0400
                Re: Need some SQL Ron Weiner <rw@domain.com> - 2021-08-15 14:47 -0400
                Re: Need some SQL Keith Tizzard <internet.shopping@foobox.com> - 2021-08-15 12:35 -0700
                Re: Need some SQL Ammammata <ammammata@tiscalinet.it> - 2021-08-17 08:16 +0000
                Re: Need some SQL Ron Weiner <rw@domain.com> - 2021-08-19 17:30 -0400
  Re: Need some SQL Mike P <mikewpayne@tiscali.co.uk> - 2021-08-19 02:26 -0700

csiph-web