×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




There are different ways to do it, but your where clause could look something like this:

where XMittalDate between $startDate and $endDate



From: "Shannon ODonnell" <sodonnell@xxxxxxxxxxxxxxxxxxxxxxxxx>
To:"'Web Enabling the AS400 / iSeries'" <web400@xxxxxxxxxxxx>
Date: 1/13/2010 11:27 AM
Subject: [WEB400] SQL Date Range
I want to select a group of dates based on date range in a PHP app from a
MySQL database.



Assume the table name is xmittalheader and the date field is named:
XMittalDate and is in the format in the MySQL table like this: 11/02/2009



Further assume $startDate and $endDate are being brought into the PHP via a
POST from a form.



Would this be the correct syntax?





$results = mysqli_query($db, "SELECT * FROM xmittalheader WHERE XMittalDate
BETWEEN ".$startDate." and ".$endDate);





Thanks!





Shannon O'Donnell






This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.