Welcome Guest, Not a member yet? Register   Sign In
help with Date functions
#1

[eluser]cherryworld4u[/eluser]
Hye There!
plz help me with some date functions.

i have two dates saved in database... nd then i want to check another date whether it exists between two dates of database or not.... wht shold i use? plz help me
thnx
#2

[eluser]Thorpe Obazee[/eluser]
Code:
SELECT * FROM EMPLOYEE1
WHERE thedate BETWEEN '2008-12-01' AND '2008-12-03';
#3

[eluser]cherryworld4u[/eluser]
i want to check third date whether it comes between two dates that are in database...
is there any cmnd like

select * frm table where date3 comes between dat1 and date 2
#4

[eluser]Thorpe Obazee[/eluser]
Have you tried it? Have you tried google?
#5

[eluser]cherryworld4u[/eluser]
ya bt didnt got any valid result...
#6

[eluser]cherryworld4u[/eluser]
Do nybdy knw any logic to do this....plz help Sad
#7

[eluser]Michael Wales[/eluser]
What database are you running, what version? There are a ton of solutions to this, clearly available on Google.

MySQL >= 5.0, BETWEEN works fine - make sure you CAST() to a common datatype if they are not the same. Any other version/database, do a little logically thinking...

Code:
theDate BETWEEN lowDate AND highDate
sounds a lot like
Code:
lowDate < theDate < highDate
#8

[eluser]cherryworld4u[/eluser]
Ya thnx dear!




Theme © iAndrew 2016 - Forum software by © MyBB