[NEW][SQL] BETWEEN implemented

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Jun 26 18:02:38 CDT 2003


on 6/22/03 1:30, Claudius Sailer at Claudius at sailer-online.de wrote:

> Could the following Result explain the understanding ot BETWEEN? Ist it
> possible that 31.12.2003 means in this environment 31.12.2002 00:00:00?
> Then I understand the result.
> 
> 
> Claudius
> 
> 
> SELECT * FROM ZeitKonto
> WHERE AnfangsZeit BETWEEN 01.01.2002 AND 01.01.2003
> ORDER BY AnfangsZeit
> 
> AnfangsZeit    EndZeit    Auftraggeber    Projekt    Taetigkeit
AbrechnungsSatz    
> Kommentar
> 02.04.2002 07:00:00    02.04.2002 08:00:00    2    6    5    8500
> 28.12.2002 07:00:00    28.12.2002 17:00:00    2    13    16    8500
> 30.12.2002 07:00:00    30.12.2002 15:00:00    2    13    16    8500
> 30.12.2002 15:00:00    30.12.2002 15:30:00    2    3    11    8500
> 31.12.2002 07:00:00    31.12.2002 15:00:00    2    13    16    8500
> 
> 
> SELECT * FROM ZeitKonto
> WHERE AnfangsZeit BETWEEN 01.01.2002 AND 31.12.2002
> ORDER BY AnfangsZeit
> 
> AnfangsZeit    EndZeit    Auftraggeber    Projekt    Taetigkeit
AbrechnungsSatz    
> Kommentar
> 02.04.2002 07:00:00    02.04.2002 08:00:00    2    6    5    8500
> 28.12.2002 07:00:00    28.12.2002 17:00:00    2    13    16    8500
> 30.12.2002 07:00:00    30.12.2002 15:00:00    2    13    16    8500
> 30.12.2002 15:00:00    30.12.2002 15:30:00    2    3    11    8500

Claudius,

1) am I right that AnfangsZeit is DateTime field


2) then I think all right.
Because in second query you say
    
        AnfangsZeit BETWEEN 01.01.2002 AND 31.12.2002
                                           ^^^^^^^^^^^^
This is the same as:

       AnfangsZeit BETWEEN 01.01.2002 AND 31.12.2002 00:00:00

By the way!!!
You need to use quotes around  dates:

       AnfangsZeit BETWEEN '01.01.2002' AND '31.12.2002 00:00:00'

So result is expected.
You specify not full Date Time value, Valentina adds ZEROs.

You think this is not correct?

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list