473,506 Members | 14,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to write MySQL command

1 New Member
i have table name login_master and one field in there is "date_of_event"
example value date_Of_Event Jun 7, 2006 3:31:10 AM

Jun 7, 2006 to Jun 11, 2006 (I don't need time),how to write MySQL command?

pls help me

with regards,
rajesh
Jan 29 '08 #1
4 2052
debasisdas
8,127 Recognized Expert Expert
You need to convert the date to proper format for the purpose.
Jan 29 '08 #2
mwasif
802 Recognized Expert Contributor
What is the datatype of date_of_event? It looks like your data is in string format, then you can use STR_TO_DATE() function. In case of datetime data type, you can use DATE_FORMAT().
Feb 6 '08 #3
amitpatel66
2,367 Recognized Expert Top Contributor
i have table name login_master and one field in there is "date_of_event"
example value date_Of_Event Jun 7, 2006 3:31:10 AM

Jun 7, 2006 to Jun 11, 2006 (I don't need time),how to write MySQL command?

pls help me

with regards,
rajesh
Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT * FROM login_master WHERE DATE_FORMAT(date_of_event, '%M %e %Y')  BETWEEN DATE_FORMAT('June 7 2006','%M %e %Y') AND DATE_FORMAT('June 11 2006','%M %e %Y');
  3.  
  4.  
Feb 7 '08 #4
Expand|Select|Wrap|Line Numbers
  1. $tourneylist=mysql_query("SELECT tid,name FROM tourneys ORDER by name");
  2. while(list($tid,$name)=mysql_fetch_row($tourneylist)){
  3. $tourneylistid.="<option value='$tid'>$name</option>\n";
  4. }
  5.  
Oct 19 '10 #5

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

Similar topics

2
2544
by: Cathy Hui | last post by:
Do u know why do i get the following message when trying to build the MySql-Python (1.2.0) on my Solaris 8 system? (with mysql 4.0.21 and python 2.4). thanks! error mesg: ld: fatal:...
3
863
by: Mark Adams | last post by:
I am a relative newbie to MySQL. I had a Postfix+Courier+MySQL mail server running for several months. It took me a week or so to get it up and running in September. Now, I did a clean upgrade to...
0
5824
by: Mark Adams | last post by:
I am a relative newbie to MySQL. I had a Postfix+Courier+MySQL mail server running for several months. It took me a week or so to get it up and running in September. Now, I did a clean upgrade to...
0
3925
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
4
5844
by: Dave | last post by:
I have a MS sql 2000 db that needs to sync with a Mysql db. When a password is changed in the MS SQL table, I need to make sure that the same value is updated in the Mysql db. I dont have any...
16
27874
by: MLH | last post by:
Using MS Access, I have attached to MySQL servers in other states and other countries on the other side of my router. But when I use the MySQL ODBC driver 3.51 to connect to a MySQL server on my...
1
2817
by: Good Man | last post by:
Hi there I've noticed some very weird things happening with my current MySQL setup on my XP Laptop, a development machine. For a while, I have been trying to get the MySQL cache to work....
3
10287
by: the.natalie | last post by:
Hi. I am a newbie to mysql, cron, and shell scripting, so please bear with me. I have a script that is used for updating an image directory based on contents in a database. The script does the...
3
3373
by: apostolosl | last post by:
Hi there. I need to update a remote database from a local one. I use mysqldump in my php page in order to create a file for each table, like this: $command="mysqldump table_products >...
6
38453
Atli
by: Atli | last post by:
This is an easy to digest 12 step guide on basics of using MySQL. It's a great refresher for those who need it and it work's great for first time MySQL users. Anyone should be able to get...
0
7220
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
7308
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,...
1
7023
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7479
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
410
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.