SELECT * FROM zm.Frames F
WHERE F.TimeStamp between ('2005/12/1 00:00:00') and ('2005/12/1 23:59:59')
sql statements
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
its ok got it i needed a between >= date 00:00:00 and <= 23:59:59
James Wilson
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
Yes, although I never use between as I can't remember where the boundaries are so I would use
Using hypens rather than slashes also makes it clearer the format you are using and is what mysql uses itself.
Phil
Code: Select all
... where StartTime >= "2005-12-05" and StartTime < "2005-12-06";
Phil
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
i thought of that but i have made the app select a date from a calender control so, i wanted to avoid the problem of the end of the month as i wouldnt have been able to just add 1 day to the selected date as i have split them up so i can convert them from ms to mysql, it seems mysql uses dates backwards
James Wilson
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
I'm not sure I exactly understand the problem but you can also do
in case that's relevant.
Phil
Code: Select all
... where StartTime >= somedate and StartTime < somedate + interval 1 day;
Phil
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
if i use a datepicker in ms i get 29/12/05 so i split it up into individual parts ie day/month/year reorganise them as variables and pass into the sql string command
as its not a whole date i assumed that mysql would get it wrong, but then again whilst googling for sql help realised that mysql is a bit powerful aint it lol
james
as its not a whole date i assumed that mysql would get it wrong, but then again whilst googling for sql help realised that mysql is a bit powerful aint it lol
james
James Wilson
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
Yes, for dates and times, http://dev.mysql.com/doc/refman/4.1/en/ ... tions.html is your friend
Just be a little careful that mysql distinguishes between dates, times, datetimes and timestamps in some circumstances.
Phil
Just be a little careful that mysql distinguishes between dates, times, datetimes and timestamps in some circumstances.
Phil
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
i know its all getting a bit complicated for me lol. im not looking forward the sql bit of the multicam playback code
lol
lol
James Wilson
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
-
- Posts: 5111
- Joined: Wed Jun 08, 2005 8:07 pm
- Location: Midlands UK
youll always have a job lol
James Wilson
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk