On May 1, 9:06 pm, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 1 May, 12:03, skinhat <skin...@gmail.com> wrote:
>
>
>
> > On May 1, 8:49 pm, "J.O. Aho" <u...@example.net> wrote:
>
> > > skinhat wrote:
> > > >> SELECT
> > > >> DISTINCT `sid`
> > > >> WHERE LEFT(FROM_UNIXTIME(`cid`),10) = '2007-12-08';
>
> > > > This wouldnt work because the 'cid' field doesnt hold the date. Its
> > > > just a unique identifier.
>
> > > Yes, the cid column does hold the date, it's just in a unixtime format and the
> > > FROM_UNIXTIME() function would then convert it to a human readable format
>
> > Notice in the table these records:
>
> > 2 1176718828 0 12
> > 2 1176718828 1 18
> > 2 1176718828 2 2007
>
> > 3 1176718828 0 4
> > 3 1176718828 1 5
> > 3 1176718828 2 2008
>
> > Both have the same CID yet represent different dates. The first is
> > 12/18/2007 and the second is 4/5/2008.
>
> If they both have the same cid value than it is hardly a "unique"
> identifier!
The CID is unique to a certain date field. 1176718828 represents a
date where no=0 is the day, no=1 month and no=2 is the year. A SID is
equivalent to a record. This is the way drupal do it (
www.drupal.org)
for its webform module for dates.