473,396 Members | 2,068 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,396 software developers and data experts.

REQ: MySQL 4.0 equivilent of "DateDiff("m", Date, Now())=1"

I have a query that works in the rest of the SQL world

"SELECT invoice.*, invoice.Date
FROM invoice
WHERE (DateDiff("m", Date, Now())=1);"

which will give me all of last month's invoices.

However it doesn't work with MySQL 4.0.

While

"SELECT
Invoice.*
FROM
invoice
WHERE
(Month(Invoice.Date) = ((Month(Now()))-1))"

Is a close substituent, it will blowup in January.

Anyone have an equivalent expression for MySQL 4.0?

Thanks
Jul 20 '05 #1
0 3280

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

Similar topics

3
by: Paul Brown | last post by:
I have a datebase of events. I have a form that adds to it, and I have a form that removes from it (with checkboxes). And I have a php file that will view all the events, either all of them or...
1
by: Yong Wang | last post by:
> Hi: > We have a database system. In the database, we have an > attribute called date0, which contains date data (format: > i. e. 2004-08-12). I wrote a script to fetch the data > in a...
0
by: Jonas Gorauskas | last post by:
I am having this one problem on an app I am writing where it shows the following error on some error trapping that I did: Query failed: Error Number: 1064 Description: You have an error in...
1
by: yasaswi | last post by:
I tried searching but to no avail. Does any one know when MySQL 5, stable production release will come out? Also will the MySQL 5, stable, production release include InnoDB engine? Thanks, Yasaswi
1
by: pizzy | last post by:
Problem: I am trying to develope my personal site to select from my mysql database and organize data on the page so that it will display all the submissions for that day, then break and display...
2
by: monomaniac21 | last post by:
Hi all can mysql be queried so it finds and then adds the current date to a field without requiring a php function to get the date for it?
1
by: Jneedles | last post by:
Relatively new to PHP and MySQL... I've got a field named live_date as a date type field within my DB. I need to split the display table into M-F weeks, projected out from todays date based on...
2
by: webmonkie | last post by:
Hi, I am hoping someone can point me in the right direction as I have been trying to fix this issue for a good while now. I am trying to take information out of a xml file using php and parsing it...
0
by: Syed Khaleel Ahamed | last post by:
Dear Sir, I want to get the difference of date/time captured in mysql and present date/time in jsp. I am using the following code to get, but its getting difference only in hrs, i used...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...

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.