-
May 20th, 2021, 04:37 AM
#1
Thread Starter
PowerPoster
SELECT record from to dates
TIPO DAL AL MM AAAA NRGG
1-SINGOLA 23/08/2021 23/08/2021 8 2021 1
31-SUITE 20/02/2021 28/02/2021 2 2021 9
6-SINGOLA 03/05/2021 10/05/2021 5 2021 7
8-SINGOLA 20/02/2021 28/02/2021 2 2021 8
8-SINGOLA 05/01/2021 10/01/2021 1 2021 6
i need a sql to select record between 20/02/2021 to 28/02/2021
-
May 20th, 2021, 04:57 AM
#2
Re: SELECT record from to dates
What's the result you're expecting? I see 2 records matching your description
SELECT * FROM MyTable WHERE DAL=20/02/2021 AND AL=28/02/2021
No idea about missing quotation marks. Try and error
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
May 20th, 2021, 06:56 AM
#3
Re: SELECT record from to dates
Oddly the answer was in your question...
Originally Posted by luca90
i need a sql to select record between 20/02/2021 to 28/02/2021
Code:
seelct * from whateveryourtablenameissinceyoudidntprovideiyougethisinstead where icantellwhatyourdatefieldnameis between "2021-02-20" and "2021-02-28"
I prefer the ISO format for dates when using them like this so there is no ambiguity. IF you're using parametters *koff**koff* then make sure everything is of the correct ype and it should be fine.
-tg
-
May 20th, 2021, 07:02 AM
#4
Re: SELECT record from to dates
Originally Posted by luca90
TIPO DAL AL MM AAAA NRGG
1-SINGOLA 23/08/2021 23/08/2021 8 2021 1
31-SUITE 20/02/2021 28/02/2021 2 2021 9
6-SINGOLA 03/05/2021 10/05/2021 5 2021 7
8-SINGOLA 20/02/2021 28/02/2021 2 2021 8
8-SINGOLA 05/01/2021 10/01/2021 1 2021 6
i need a sql to select record between 20/02/2021 to 28/02/2021
did you try the search or Codebank ?
did you try a google search ?
your here since 2005 and still end you questions with...
i need ...
or
how to ?
come on Luca, try and start programming yourself a bit
to hunt a species to extinction is not logical !
since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.
-
May 20th, 2021, 07:54 AM
#5
Re: SELECT record from to dates
Originally Posted by techgnome
Oddly the answer was in your question...
Code:
seelct * from whateveryourtablenameissinceyoudidntprovideiyougethisinstead where icantellwhatyourdatefieldnameis between "2021-02-20" and "2021-02-28"
I prefer the ISO format for dates when using them like this so there is no ambiguity. IF you're using parametters *koff**koff* then make sure everything is of the correct ype and it should be fine.
-tg
Eh?
I'd say no.
tg, look at his table-design (what one can derive from it)
20/02/2021 has its own column (DAL?) compared to 28/02/2021 (AL?)
looks like 2 columns, kinda like "StartDate - EndDate", so the BETWEEN-Operator wouldn't work
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
May 20th, 2021, 08:11 AM
#6
Re: SELECT record from to dates
Originally Posted by Zvoni
Eh?
I'd say no.
tg, look at his table-design (what one can derive from it)
20/02/2021 has its own column (DAL?) compared to 28/02/2021 (AL?)
looks like 2 columns, kinda like "StartDate - EndDate", so the BETWEEN-Operator wouldn't work
Maybe, maybe not... depends on what he's after... but with Luca... it's a 50/50 gamble... we've each taken a shot. Now we wait a couple days to see what he may or may not say. Either way I fully expect the next reply of his to throw a box of wrenches into it, expose a new requirement, or to tell us that the dates are actually strings.
-tg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|