SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    2,059
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Referring to a particular day in the week

    Ho do I refer to a particular day in a week? I'm working on a site where new products will be added every Friday! I need to refer to that day so I can output only the records that where added that Friday?

    Thank you in advance

  2. #2
    SitePoint Evangelist
    Join Date
    Mar 2007
    Posts
    584
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In CF, DayOfWeek(dateValue) returns the day of week number (ie 1 through 7). Most db's have similar function(s), such as MS SQL has the functions: Weekday(dateCol) and DatePart(dw, dateCol).
    http://msdn.microsoft.com/en-us/library/ms174420.aspx

    The number representing "Friday" depends on which technique you use and your db settings** (ie some date functions are non-deterministic! So code accordingly).


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •