Populating dataset
am 25.03.2010 17:50:43 von Tompkins Neil
--0015174027a6fea7430482a2d8bc
Content-Type: text/plain; charset=ISO-8859-1
Hi,
We have a table which contains the following sample of information
2010-03-20
2010-03-21
2010-03-22
2010-03-23
2010-03-26
2010-03-27
2010-03-28
2010-03-30
As you can see, the dates listed are not constant e.g missing 2010-03-29 as
a example. For our query like SELECT check_in_date FROM bookings how would
I know to automatically insert a missing date like 2010-03-29 between the
date range I search ?
Thanks,
Neil
--0015174027a6fea7430482a2d8bc--
Re: Populating dataset
am 25.03.2010 19:38:27 von Johnny Withers
--0016e6d464cc46171c0482a45a18
Content-Type: text/plain; charset=ISO-8859-1
Wouldn't you want to handle that on the application side? Otherwise, you
would have to have a table of all possible dates to do some kind of join to
find missing values. (I would think).
JW
On Thu, Mar 25, 2010 at 11:50 AM, Tompkins Neil <
neil.tompkins@googlemail.com> wrote:
> Hi,
>
> We have a table which contains the following sample of information
>
> 2010-03-20
> 2010-03-21
> 2010-03-22
> 2010-03-23
> 2010-03-26
> 2010-03-27
> 2010-03-28
> 2010-03-30
>
> As you can see, the dates listed are not constant e.g missing 2010-03-29 as
> a example. For our query like SELECT check_in_date FROM bookings how would
> I know to automatically insert a missing date like 2010-03-29 between the
> date range I search ?
>
> Thanks,
> Neil
>
--
-----------------------------
Johnny Withers
601.209.4985
johnny@pixelated.net
--0016e6d464cc46171c0482a45a18--
Re: Populating dataset
am 26.03.2010 09:50:12 von Martijn Tonies
Hi,
> We have a table which contains the following sample of information
>
> 2010-03-20
> 2010-03-21
> 2010-03-22
> 2010-03-23
> 2010-03-26
> 2010-03-27
> 2010-03-28
> 2010-03-30
>
> As you can see, the dates listed are not constant e.g missing 2010-03-29
> as
> a example. For our query like SELECT check_in_date FROM bookings how
> would
> I know to automatically insert a missing date like 2010-03-29 between the
> date range I search ?
So, you want to "select" something that isn't available from the database?
Makes you wonder why you need to go to the database for this at all...
?
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
Database questions? Check the forum:
http://www.databasedevelopmentforum.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: Populating dataset
am 26.03.2010 15:39:43 von Peter Brawley
--------------050106030808060304050108
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
> how would I know to automatically insert a missing date
A common problem. Build a calendar table (http://www.artfulsoftware.com/infotree/queries.php?#95)
PB
-----
Tompkins Neil wrote:
> Hi,
>
> We have a table which contains the following sample of information
>
> 2010-03-20
> 2010-03-21
> 2010-03-22
> 2010-03-23
> 2010-03-26
> 2010-03-27
> 2010-03-28
> 2010-03-30
>
> As you can see, the dates listed are not constant e.g missing 2010-03-29 as
> a example. For our query like SELECT check_in_date FROM bookings how would
> I know to automatically insert a missing date like 2010-03-29 between the
> date range I search ?
>
> Thanks,
> Neil
>
>
> ------------------------------------------------------------ ------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.437 / Virus Database: 271.1.1/2769 - Release Date: 03/25/10 07:33:00
>
>
--------------050106030808060304050108--