Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2006
    Posts
    17

    Conditional Format Query

    I have a query that brings up a job#, its start date (mm/dd/yyyy), and its
    priority status (Low, Medium, or High).

    Is there SQL I can use to make another query that will look at the start date, and if it is a week old, change the priority status to Medium, and if it's a month old, change the priority to High?

  2. #2
    Join Date
    Dec 2005
    Location
    Wilmington, DE - USA
    Posts
    275
    Try:

    SELECT JobID, StartDate, IIf((StartDate + 30) > Date(), "High", IIf((StartDate + ) > Date(), "Medium", [Status])) AS JobStatus
    FROM Jobs

    It assumes all the data is coming from one table, and if the job is less than one week old you want to retain whatever status it already had.

  3. #3
    Join Date
    Mar 2006
    Posts
    17
    Correct on your assumption Patrick. I will try out your example and let you know if I'm successful. Thanks very much!---

    Schwagr

  4. #4
    Join Date
    Dec 2005
    Location
    Wilmington, DE - USA
    Posts
    275
    Schwagr,

    I noticed a typo. Here's a corrected version:

    SELECT JobID, StartDate, IIf((StartDate + 30) > Date(), "High", IIf((StartDate + 7) > Date(), "Medium", [Status])) AS JobStatus
    FROM Jobs

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Issue with conditional imput
    By Estyl in forum Forms
    Replies: 2
    Last Post: 02-19-2008, 10:42 AM
  2. Text Box Format
    By Scott in forum Forms
    Replies: 0
    Last Post: 01-09-2008, 11:13 PM
  3. Conditional Update query ...
    By valkyry in forum Access
    Replies: 0
    Last Post: 04-25-2007, 02:04 PM
  4. Date Format
    By wasim_sono in forum Forms
    Replies: 2
    Last Post: 08-15-2006, 01:20 AM
  5. Date Format
    By St3ph3n in forum Access
    Replies: 4
    Last Post: 03-09-2006, 11:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums