Announcement

Collapse
No announcement yet.

SQL Question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL Question

    How do I do a date compare on the 'dateline' field in the 'post' table. I assume 'dateline' is the time/date the post was made and I want to do a select that goes like this:

    select * from post where dateline >= '7-8-2000' and dateline <= '8-8-2000'

    That isn't working and I checked the dateline field is an INT field and not a datetime field. What do I need to do? The dates are in american format btw (July 8, 2000 and Aug 8, 2000)

    [Edited by rangersfan on 07-10-2000 at 04:08 PM]

  • #2
    This should work. Untested, but I'm pretty sure it goes like this:
    Code:
    select * from post where FROM_UNIXTIME(dateline)>='7-8-2000' and FROM_UNIXTIME(dateline)<='8-8-2000'
    Anyway, moving to PHP Coding forum (hey, it's the closest thing!)

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X