ASP + Time() + Access DB

Discussion in 'ASP General' started by Stuart, Jun 25, 2004.

  1. Stuart

    Stuart Guest

    Hi all,

    I have a problem that I just cannot figure out for the
    life of me.

    I am trying to set up a database that contains time slots
    (6 X 4hr periods to cover the day) starting from 00:00:00 -
    03:59:59 etc etc etc.

    DB Fields look like this
    | ID | EmailAdress | FromTime | ToTime |

    Now once some one does an event of some sort, I wish to
    email the person(s) contained with in the database.

    The SQL string I am using in Select EmailAddress from
    tblTable where #time()# BETWEEN FromTime and ToTime.

    This however is causing me to get either 2 records (one is
    correct one is wrong) displayed or no records displayed.

    Am I doing this completely wrong? If so is there another
    way?

    Many thanks for help on this

    Stuart
    Stuart, Jun 25, 2004
    #1
    1. Advertising

  2. Since you have identical time slots for every day, why not just use TimeSlot
    = 1, 2, 3, 4, 5, 6. Then have a lookup table if you want a nice display for
    the actual time they used. Your ASP code can easily take a time and convert
    it to a time slot, to pass into the query...

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "Stuart" <> wrote in message
    news:210d101c45abf$9e479040$...
    > Hi all,
    >
    > I have a problem that I just cannot figure out for the
    > life of me.
    >
    > I am trying to set up a database that contains time slots
    > (6 X 4hr periods to cover the day) starting from 00:00:00 -
    > 03:59:59 etc etc etc.
    >
    > DB Fields look like this
    > | ID | EmailAdress | FromTime | ToTime |
    >
    > Now once some one does an event of some sort, I wish to
    > email the person(s) contained with in the database.
    >
    > The SQL string I am using in Select EmailAddress from
    > tblTable where #time()# BETWEEN FromTime and ToTime.
    >
    > This however is causing me to get either 2 records (one is
    > correct one is wrong) displayed or no records displayed.
    >
    > Am I doing this completely wrong? If so is there another
    > way?
    >
    > Many thanks for help on this
    >
    > Stuart
    Aaron [SQL Server MVP], Jun 25, 2004
    #2
    1. Advertising

  3. Stuart

    Evertjan. Guest

    Stuart wrote on 25 jun 2004 in microsoft.public.inetserver.asp.general:
    > I am trying to set up a database that contains time slots
    > (6 X 4hr periods to cover the day) starting from 00:00:00 -
    > 03:59:59 etc etc etc.


    Do not do that, it will fill your database withs lots of useless slots,
    since you can define the slots with an ASP/vbs formula.

    I suppose you want to fill the slots with data, so just make a database
    with these data each having a discrete time. SQL if specific data falls
    into a timeslot. You could use "where .. between .." for that.



    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Jun 25, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. engsol
    Replies:
    2
    Views:
    944
    Dan Bishop
    Jan 26, 2004
  2. Replies:
    8
    Views:
    475
    Magnus Lycka
    Aug 5, 2005
  3. Peter Hansen
    Replies:
    0
    Views:
    712
    Peter Hansen
    Feb 22, 2006
  4. Peter Hansen
    Replies:
    0
    Views:
    604
    Peter Hansen
    Feb 22, 2006
  5. flamesrock
    Replies:
    8
    Views:
    449
    Hendrik van Rooyen
    Nov 24, 2006
Loading...

Share This Page