Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 8th, 2008, 01:58 AM
Authorized User
 
Join Date: May 2008
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

got an idea from someone I was chatting to.

Basically pre-create a table that has every date over the years you're interested in. Then for each date create a column for each sorting arrangement you might want, e.g. day number, week number, month number etc. Then join the expenses table with this on date. Pretty cool...
 
Old June 9th, 2008, 01:19 AM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Yes, that's what I recommend for building event calendars.

http://www.ClearviewDesign.com/Newbie

See the "calendar of events" demo.

But I wasn't sure it was worth the effort here. If you can use it for other purposes, though, it clearly simplifies lots of queries.
 
Old June 9th, 2008, 01:32 AM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

You remember who it was who suggested the trick? Curious if he and I have "tallked".
 
Old June 9th, 2008, 02:30 AM
Authorized User
 
Join Date: May 2008
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

it's from Glenn, who has nothing to do with this forum, so I expect it would be extremely unlikely you know him...he does Crystal Reports





Similar Threads
Thread Thread Starter Forum Replies Last Post
left outer join keyvanjan Classic ASP Basics 1 April 15th, 2006 05:37 AM
left outer join keyvanjan Classic ASP Professional 0 February 5th, 2006 11:54 AM
left join msrnivas Classic ASP Databases 2 October 15th, 2004 07:37 AM
Oracle 8i inner join and left join problem puteri_84 Oracle 2 August 19th, 2004 07:14 AM
sql & join tables & find a field in multiple table trangd Beginning PHP 2 January 29th, 2004 07:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.