473,466 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem using curdate() with mysql ?

Hi,

I have an asp page running from a mysql db.
A line in my asp code runs as follows:

.........WHERE ShipDate >= curdate()

This displays the data until 'shipdate' (from the database) is less
than curdate(). The problem I have is that I need the data to appear
until 7 days after the shipdate. I have tried things like curdate()+7,
but this does not work. I have also tried Shipdate+7, but this returns
incorrect records from the past ?
Appreciate your help

David
Jul 19 '05 #1
3 9880
da***@scene-double.co.uk (David) wrote in message news:<c1**************************@posting.google. com>...
Hi,

I have an asp page running from a mysql db.
A line in my asp code runs as follows:

........WHERE ShipDate >= curdate()

This displays the data until 'shipdate' (from the database) is less
than curdate(). The problem I have is that I need the data to appear
until 7 days after the shipdate. I have tried things like curdate()+7,
but this does not work. I have also tried Shipdate+7, but this returns
incorrect records from the past ?


You can't trust returned date values from non-valid input.
You probably want someting like
DATEADD("2000-12-01",INTERVAL 7 DAY)

Also see:
http://www.mysql.com/doc/en/Date_and...functions.html

Bart
Jul 19 '05 #2
da***@scene-double.co.uk (David) wrote in message news:<c1**************************@posting.google. com>...
Hi,

I have an asp page running from a mysql db.
A line in my asp code runs as follows:

........WHERE ShipDate >= curdate()

This displays the data until 'shipdate' (from the database) is less
than curdate(). The problem I have is that I need the data to appear
until 7 days after the shipdate. I have tried things like curdate()+7,
but this does not work. I have also tried Shipdate+7, but this returns
incorrect records from the past ?


You can't trust returned date values from non-valid input.
You probably want someting like
DATEADD("2000-12-01",INTERVAL 7 DAY)

Also see:
http://www.mysql.com/doc/en/Date_and...functions.html

Bart
Jul 19 '05 #3
da***@scene-double.co.uk (David) wrote in message news:<c1**************************@posting.google. com>...
Hi,

I have an asp page running from a mysql db.
A line in my asp code runs as follows:

........WHERE ShipDate >= curdate()

This displays the data until 'shipdate' (from the database) is less
than curdate(). The problem I have is that I need the data to appear
until 7 days after the shipdate. I have tried things like curdate()+7,
but this does not work. I have also tried Shipdate+7, but this returns
incorrect records from the past ?


You can't trust returned date values from non-valid input.
You probably want someting like
DATEADD("2000-12-01",INTERVAL 7 DAY)

Also see:
http://www.mysql.com/doc/en/Date_and...functions.html

Bart
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jan Nordgreen | last post by:
I use php4 and winxp. This query works as expected: $result = mysql_query(" SELECT feventid, UNIX_TIMESTAMP(fdate) as fdate, ftitle, fpostedby, fdetails, factive, UNIX_TIMESTAMP(fpostdate) as...
0
by: David | last post by:
Hi, I have an ASP app running via our MySQL server. On one of my .asp pages I have an sql string as follows: .......WHERE ShipDate >= curdate()-7 This worked great up until the end of...
1
by: John Rappold | last post by:
I've Googled this, but can't find an answer to my problem. When a user selects a page with the recordset I want it to list dates that fall into a certain range, related to CURDATE(). The range...
2
by: Ben | last post by:
Hi, I have a problem with this query: $link = mysql_connect("localhost", "root", "pw"); $dbsel = mysql_select_db('mydb', $link); $lol='bibi'; $sql = "select count(*) as totuur from...
0
by: nrip | last post by:
Dear All, I am facing a very peculiar problem. I am reading a CSV file from my JSP code and trying to insert them into MYSQL database. the program first reads a line and then splits it into words...
9
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo"...
6
by: kyandebishop | last post by:
Hello everybody. I took database course two years ago and I am having a serious problem. I created a table called pet with mySQL 5.0 and it has 6 fields. Among them are two fields for birth Date ...
1
by: JFKJr | last post by:
Hello everyone, the following Access VBA code opens an excel file and creates textboxes in a given range of cells dynamically. The code attaches "MouseUP" and "Exit" events to the textboxes (using...
2
by: Steve | last post by:
Hi, I'm trying to write an SQL statement that provides a list of insurance/ product groups and then lists a total and percentage on the same line e.g. XX 5 4 80% XY 10 5 ...
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
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
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
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...
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.