<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2900.3429" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New" color=#0000ff>Well,
the structure can be updated to accommodate the problem :)</FONT></SPAN></DIV>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New"
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New" color=#0000ff>for
the most part, what I described is the structure and problem I'm trying to
solve</FONT></SPAN></DIV>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New"
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New"
color=#0000ff> one [arbitrary] table with a field of type DATE* that
contains the first "event"</FONT></SPAN></DIV>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New"
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New"
color=#0000ff> one table with a NUMERIC field indicating which WEEK this
event unfolds, where "1" == the date indicated in the first table (this
could be changed so that "0" indicates the first event)</FONT></SPAN></DIV>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New"
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New"
color=#0000ff> one table with a single DATE* field containing days
that events should NOT occur -- in which case that event and all subsequent
events should occur one week later [unless, of course, that date is also in this
table]</FONT></SPAN></DIV>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New"
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New" color=#0000ff>*
DATE* can be DATE, DATETIME, TIMESTAMP, or any other suitable field type that
would store a "date" as a minimum.</FONT></SPAN></DIV>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New"
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New" color=#0000ff>This
should be as database-neutral as possible :)</FONT></SPAN></DIV>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New"
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New" color=#0000ff>Any
chance you could make it to Devsig this saturday? Might make for a lively
discussion ...</FONT></SPAN></DIV>
<DIV><SPAN class=495512217-29102008><FONT face="Courier New"
color=#0000ff></FONT></SPAN> </DIV>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
sgvlug-bounces@sgvlug.net [mailto:sgvlug-bounces@sgvlug.net] <B>On Behalf Of
</B>Solomon K. Chang<BR><B>Sent:</B> Wednesday, October 29, 2008 12:52
AM<BR><B>To:</B> SGVLUG Discussion List.<BR><B>Subject:</B> Re: [SGVLUG] Can
SQL even do this?<BR><BR></FONT></DIV>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD vAlign=top>Well, that's MySQL-specific. Thom hasn't yet said
what flavor of SQL he's using.<BR><BR>Personally, as someone who's had
to do plenty of weekly date calcs from SQL syntax, yes, date_add and
date_sub are your friends. When you need to render DATE data types
into a humanly readable format, use date_format.<BR><BR>As someone who
claims to be the premier MySQL guru of Southern California, I'll take on
your problem in full stride. Send me the structure of your tables
and a description of what you're trying to do...<BR><BR><BR>Solomon
Chang<BR><BR><BR>--- On <B>Tue, 10/28/08, Alan Horn
<I><ahorn@deorth.org></I></B> wrote:<BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">From:
Alan Horn <ahorn@deorth.org><BR>Subject: Re: [SGVLUG] Can SQL
even do this?<BR>To: "SGVLUG Discussion List."
<sgvlug@sgvlug.net><BR>Date: Tuesday, October 28, 2008, 8:37
PM<BR><BR><PRE>On Tue, 28 Oct 2008, John E. Kreznar wrote:<BR><BR>> -----BEGIN PGP SIGNED MESSAGE-----<BR>> Hash: SHA1<BR>><BR>> "Emerson, Tom \(*IC\)"<BR><Tom.Emerson@wbconsultant.com> writes:<BR>><BR>>> I've got an "interesting" problem -- ... I'm not<BR>even sure how to<BR>>> convert "11/02/2008 + 3" to get "11/16/2008" ...<BR>><BR><BR>A quick net search turns up this :<BR>http://www.devshed.com/c/a/MySQL/Date-Arithmetic-With-MySQL/3/<BR><BR>mysql has the DATE_ADD and DATE_SUB functions.<BR><BR>They do what you would expect.<BR><BR>Cheers,<BR><BR>Al<BR><BR></PRE></BLOCKQUOTE></TD></TR></TBODY></TABLE><BR></BLOCKQUOTE></BODY></HTML>