Results 1 to 3 of 3

Thread: Query Problem

  1. #1
    Join Date
    May 2004
    Posts
    55

    Unanswered: Query Problem

    I am trying to run a query that will compare two fields from two different tables.
    SCHEDULE HISTORY
    START_DATE START_DATE

    If a user enters a new date, it will be updated in the SCHEDULE Table. I want to take this date and compare it with every START_DATE in HISTORY. If the result of that query is null I would like to process with that date, but if that date is present in the HISTORY table then I would like to display a message, "ALREADY TAKEN". Can I do all of this in a query in access. In otehr words, how can you check whether the result of a query was null or not?

    Any suggestions??

    Thanks,
    D

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    1)
    select dateColumn
    from tableA
    where dateColumn = [param]

    2)
    Select dateColumn
    from tableB tb
    where EXISTS
    (select null
    from tableA
    where dateColumn = tb.dateColumn)
    Last edited by r123456; 06-09-04 at 06:07.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  3. #3
    Join Date
    May 2004
    Posts
    55
    Quote Originally Posted by r123456
    1)
    select dateColumn
    from tableA
    where dateColumn = [param]

    2)
    Select dateColumn
    from tableB tb
    where EXISTS
    (select null
    from tableA
    where dateColumn = tb.dateColumn)
    Hey!! That worked! But I want to display a message to the user if the query result is not null. If it is null, which means that the date is not used and I can go ahead and do other things.

Posting Permissions

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