Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2005
    Posts
    11

    Unanswered: Sql Date question

    Hello everyone Im horrible at querying anything related to a date. I need a bit of help. I am inserting a schedule into the database. I later want to pull the data that is older than the current time of the query. what I have below is the previous attempt.


    s.schedule_time <= getdate()


    Thanks for your help.
    Last edited by kweli; 06-24-11 at 15:15.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I can't see anything wrong with what you've posted so far, but I'm having to assume an awful lot. Maybe someone else can help with what you've posted so far, but I'd need to see more (probably all) of your code to help you.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Nov 2005
    Posts
    11

    This is the query but I

    This is the full query it doesnt seem to be working as desired ive broken down each clause to confirm they are correct and they are.

    Thanks for any suggestions


    Code:
    select s.schedule_id, c.Contact_name, contact_number, g.group_id, g.Group_name, s.Schedule, m.message, m.message_id
                from Contacts as c with (nolock), Messages as m with (nolock), Schedule as s with (nolock), Groups as g with (nolock)
                where c.group_id = g.group_id and
                s.group_id = g.group_id and
                s.message_id = m.message_id and
                job_complete is NULL and
                s.schedule <= getdate()

  4. #4
    Join Date
    Nov 2005
    Posts
    11
    sorry i restarted my server and its working now. IM not sure what was wrong but it works perfectly well now

    thanks

Posting Permissions

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