473,472 Members | 2,224 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

mysql using between

83 New Member
Sir

My table name ss with the field cur_date data type varchar()

show create table ss;
+-------+-----------------------------------------------------------------------
---------------------------+
| Table | Create Table
|
+-------+-----------------------------------------------------------------------
---------------------------+
| ss | CREATE TABLE `ss` (
`cur_date` varchar(18) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-----------------------------------------------------------------------
---------------------------+
1 row in set (0.01 sec)

select * from ss;

+-------------+
| cur_date |
+-------------+
| 11-oct-2006 |
| 12-oct-2006 |
| 15-oct-2006 |
| 20-oct-2006 |
+-------------+
4 rows in set (0.03 sec)

In this i want to select the particular dates by using the between & and commands.

my cmd is

select * from ss where cur_date between date_format(str_to_date('11-oct-2006',"%d-%b-%Y"),"%d-%m-%Y") and date_format(str_to_date('15-oct-2006',"%d-%b-%Y"),"%d-%m-%Y");

+-------------+
| cur_date |
+-------------+
| 11-oct-2006 |
| 12-oct-2006 |
+-------------+
2 rows in set (0.00 sec)

but in this i am changing the month that is replace oct to nov but it will also produce the result

that is
select * from ss where cur_date between date_format(str_to_date('11-nov-2006',"%d-%b-%Y"),"%d-%m-%Y") and date_format(str_to_date('15-nov-2006',"%d-%b-%Y
"),"%d-%m-%Y");

the result is also

+-------------+
| cur_date |
+-------------+
| 11-oct-2006 |
| 12-oct-2006 |
+-------------+
2 rows in set (0.00 sec)

how to overcome the problem

pls any one help to me

Thanks & Regards
Sang
Nov 3 '06 #1
1 2149
ronverdonk
4,258 Recognized Expert Specialist
Read the Posting Guidelines at the top of the forum page. Especailly the part about showing code between php, code or html tags!!

Until then I will not look at your code or samples, it's a mess!

Ronald :cool:
Nov 3 '06 #2

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

Similar topics

0
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
by: James E Koehler | last post by:
I can't get the WHILE statement to work in MySQL. The version of MySQL that I am using is: Ver 12.16 Distrib 4.0.6-gamma, for Win95/Win98 (i32) running on Windows MX. Here is the relevant...
2
by: AMD | last post by:
Hi, I would like to have MySQL use a mapped network drive. I'd like to do this in case there is a failure of the mysql machine, I can just replace it with a new machine pointing to the same...
1
by: Elaine | last post by:
hi Hopefully this is simple enough. I'm running 3.23 and 4.1.7 mysql databases. I run a /usr/bin/mysqlhotcopy backup on a specific database name , and copy my.cnf and ib* files to the backup...
3
by: Steven Sinfield | last post by:
Hi All, I am trying to use PHP & MySQL over SSL, my issue is that the data that I am querying also needs to be available by non-secure as well. Can someone please help me in doing this. ...
2
by: Beda Christoph Hammerschmidt | last post by:
MySQL, Access, ODBC, Replication Hello, i have a central mysql database that is accesed by multiple clients running MS Access with ODBC. This works fine if Access has a permanent connection...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
1
by: PowerLifter1450 | last post by:
I've been having a very rough time installinig mySQL on Linux. I have been following the instructions form here: http://www.hostlibrary.com/installing_apache_mysql_php_on_linux Everytime I get to...
6
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...
12
by: howa | last post by:
any side effect for PHP? what do you think?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.