Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SQL and ASP variables (a.k.a this is driving me insane)

SQL and ASP variables (a.k.a this is driving me insane)

Scheduled Pinned Locked Moved Web Development
databasequestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Garth
    wrote on last edited by
    #1

    I am using this statement to return some records. The statement using the ASP variable ActiveID to pull records according to categories. This works fine, but I can't seem to add further variables (e.g. How would I add an ORDER BY statement to this?) RS1.Open "SELECT * FROM Table WHERE Cat_ID =" & ActiveID, DB1, adopenstatic What I really want to do is return records updated in the last seven days or so. I have the last modified value stored in a table in the format DD/MM/YY -- is it possible to do a SQL query that will only return records updated in the past seven days?

    D T 2 Replies Last reply
    0
    • G Garth

      I am using this statement to return some records. The statement using the ASP variable ActiveID to pull records according to categories. This works fine, but I can't seem to add further variables (e.g. How would I add an ORDER BY statement to this?) RS1.Open "SELECT * FROM Table WHERE Cat_ID =" & ActiveID, DB1, adopenstatic What I really want to do is return records updated in the last seven days or so. I have the last modified value stored in a table in the format DD/MM/YY -- is it possible to do a SQL query that will only return records updated in the past seven days?

      D Offline
      D Offline
      David Wengier
      wrote on last edited by
      #2

      Garth wrote: How would I add an ORDER BY statement to this?)

      RS1.Open "SELECT * FROM Table WHERE Cat_ID =" & ActiveID & " ORDER BY Name", DB1, adopenstatic

      -- David Wengier Sonork ID: 100.14177 - Ch00k

      1 Reply Last reply
      0
      • G Garth

        I am using this statement to return some records. The statement using the ASP variable ActiveID to pull records according to categories. This works fine, but I can't seem to add further variables (e.g. How would I add an ORDER BY statement to this?) RS1.Open "SELECT * FROM Table WHERE Cat_ID =" & ActiveID, DB1, adopenstatic What I really want to do is return records updated in the last seven days or so. I have the last modified value stored in a table in the format DD/MM/YY -- is it possible to do a SQL query that will only return records updated in the past seven days?

        T Offline
        T Offline
        Torsten Mauz
        wrote on last edited by
        #3

        this should get records updated only in the last seven days as well but I haven't checked this yet as I'm late for work :D strSql = "" strSql = strSql & "SELECT * FROM Table WHERE Cat_ID =" & ActiveID strSql = strSql & " AND modifiedDate >= '"& DateAdd("d", now(), -7) &"' ORDER BY modifiedDate " RS1.Open strSql, DB1, adopenstatic HTH

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups