473,387 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

get date between defined hours

3
hello ,
i need to select some date values that are between 9:30 and 18:30 everyday.How can i do this in mysql?
Apr 7 '08 #1
6 1578
amitpatel66
2,367 Expert 2GB
Hi,

Welcome to TSDN.

Your requirement is not clear. Please provide more details on your requirement so that our experts would help you.
Apr 7 '08 #2
ronverdonk
4,258 Expert 4TB
Do you mean something like
Expand|Select|Wrap|Line Numbers
  1. select myDate from table_name where myTime between '09:30:00' and '18:30:00';
Ronald
Apr 7 '08 #3
purs
3
Do you mean something like
Expand|Select|Wrap|Line Numbers
  1. select myDate from table_name where myTime between '09:30:00' and '18:30:00';
Ronald
yes,but i have date in DATETIME format not in TIME...
can i do something like:
Expand|Select|Wrap|Line Numbers
  1. select myDate from table_name where TIME(myDate)>='09:30:00' and TIME(myDate)<='18:30:00'; 
Apr 7 '08 #4
ronverdonk
4,258 Expert 4TB
Please enclose your posted code in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

Please use [code] tags in future.


Yes, but use the BETWEEN, is a lot easier, like
Expand|Select|Wrap|Line Numbers
  1. select myDate from table_name where TIME(myDate) between '09:30:00' and '18:30:00'; 
Ronald
Apr 7 '08 #5
purs
3
thank you :) It works
Apr 7 '08 #6
ronverdonk
4,258 Expert 4TB
Of course it does! See you around.

Ronald
Apr 7 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Jeroen | last post by:
Hi, I'm searching but not finding :( I need the code that creates automatic the days in a month So like for this month, it creates the days in this format 01-Oct, 02-Oct, .... This...
16
by: Atley | last post by:
I am trying to get a overall difference on two dates, I can get the difference in Years, Months, Weeks, Days, Hours, Minutes, Seconds, no problems... What I cannot seem to figure out is how to...
12
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
15
by: Cerebral Believer | last post by:
Hi all, I am a newbie to JavaScript and am just trying to get a script going that will write the ful date and time to each webpage as it is viewed. Can anyone point out what mistakes there are...
44
by: user | last post by:
Hi, Let's say I have 2 dates in the b/m format: Date 1 and date 2 How do I check whether Date2 is later than Date 1? Date1. 21-Nov-2006 09:00:00 PM
1
by: wetsprockets | last post by:
Hello, I have two tables, WindVector (wind data) and DOH_FC88to07 (water quality samples). The WindVector table has the following fields: Date (short date) Time (short time) WindSpeed...
3
by: dave | last post by:
I need to compute an expiration date based on the number of hours, days, or months purchased. The expiration date needs to be expressed in minutes something like '1260481600'. How can I get the...
10
by: Scott | last post by:
I have an application that allows the user to pick a start date, then the enter in a number of hours to do a job, then a stop date fills out a textbox. Is there a way to find out the stop date? ...
0
yasirmturk
by: yasirmturk | last post by:
Standard Date and Time Functions The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any...
10
by: viki1967 | last post by:
Help with check date and hours Hi all. I have this form: <html> <head>
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.