Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Filling in missing dates
Hello, I'm using PHP 4 and MySQL 4.  I have a table that has two
columns -- DAY and SALES.  Let's say the values are as such:

DAY      SALES
---      -----
5-29-05  15
5-31-05  5

Is there a way in MySQL to select 3 rows of data from the table where
the 3rd row would be

5-30-05    0

?  I am hoping to construct a single query to do this.  Any help you
hvave is greatly appreciated, - Dave


Report this thread to moderator Post Follow-up to this message
Old Post
laredotornado@zipmail.com
05-31-05 09:00 PM


Re: Filling in missing dates
It would be possible with one query if you'd add an additional table with
all dates (e.g. until 2010 or so). There is an example by "santi bari" on
http://dev.mysql.com/doc/mysql/en/d...functions.html.

Other possibility would be to create an array with the required interval
first and then fill it with the required values from mysql.

Martin


<laredotornado@zipmail.com> schrieb im Newsbeitrag
news:1117545071.031614.165360@g14g2000cwa.googlegroups.com...
> Hello, I'm using PHP 4 and MySQL 4.  I have a table that has two
> columns -- DAY and SALES.  Let's say the values are as such:
>
> DAY      SALES
> ---      -----
> 5-29-05  15
> 5-31-05  5
>
> Is there a way in MySQL to select 3 rows of data from the table where
> the 3rd row would be
>
> 5-30-05    0
>
> ?  I am hoping to construct a single query to do this.  Any help you
> hvave is greatly appreciated, - Dave
>



Report this thread to moderator Post Follow-up to this message
Old Post
Martin Steiger
06-02-05 02:02 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP SQL archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:39 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.