+ Reply to Thread
Results 1 to 4 of 4

Creating a formulated query

  1. #1
    Forum Contributor
    Join Date
    06-11-2008
    MS-Off Ver
    2003
    Posts
    220

    Creating a formulated query

    I have a table with numerous fields and I am wanting to create a query using 2 of the fields. They are - Date File Received, Date Case Closed. I am wanting to create a formula so that it shows the number of days between received and closed. Any ideas? I am trying to get myself up to scratch with access as its been a few years since I have used it.

    Thanks Very Much!!!

  2. #2
    Registered User
    Join Date
    03-20-2008
    Location
    Buffalo, NY USA
    Posts
    43

    Re: Creating a formulated query

    This should do it:

    Datediff("d", [Date File Received], [Date Case Closed])

    If you want to avoid weekends, you'll need to write a function to do that. There are a fair amount of samples on the internet pertaining to those.

  3. #3
    Forum Contributor
    Join Date
    06-11-2008
    MS-Off Ver
    2003
    Posts
    220

    Re: Creating a formulated query

    Thanks very much for your help, this works, and I can now use the same rule for a few more queries I was having trouble with.

    The other query I am now struggling with is again using the same table but just one field this time which is called Success Fees Count. The formula I am trying to get is 'if success fee count is greater than 0, deliver a TRUE response)

    Thanks again!!!

  4. #4
    Registered User
    Join Date
    03-20-2008
    Location
    Buffalo, NY USA
    Posts
    43

    Re: Creating a formulated query

    This is called a conditional if statement. It's unique to access, so you won't be able to pass it in a SQL statement to a different db (say, to SQL server, for example).
    It's pretty simple to use - iif(test condition, value if test true, value if test false)

    iif([Success Fees Count]>0,True,False) --- This will return -1,0

    iif([Success Fees Count]>0,"True","False") --- This will return text True/False

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1