Results 1 to 2 of 2
  1. #1
    johnseito is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    419

    does Access have WITH clause?

    similar to some other SQL codes, such as sequel server



    something like this,

    If not, how can access adjust to this? Thx


    Code:
    ;WITH t100 AS(
     SELECT n=number FROM master..spt_values WHERE type='P' and number between 1 and 100)                 SELECT    ISNULL(NULLIF(    CASE WHEN n % 3 = 0 THEN 'Fizz' Else '' END +    CASE WHEN n % 5 = 0 THEN 'Buzz' Else '' END, ''), RIGHT(n,3)) FROM t100

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I am not an expert but I would assign my SELECT statement to a declared DAO recordset. Something like Set rcd = ""

    Then you can do something like... WITH rcd.

    I believe you can use the CASE statement within your SQL. You can build an Access query and put something in the criteria field at the bottom of the querry window. Then check SQL view to see what it looks like.

    Not sure how the IF statement will fit in though.
    Oh, and you close WITH using WEND. Just going off memory here so....

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

Similar Threads

  1. Max within a where clause
    By kdayboll in forum Queries
    Replies: 2
    Last Post: 09-14-2013, 12:13 PM
  2. Access 2007 OVER clause workaround
    By MrSmith in forum Queries
    Replies: 3
    Last Post: 07-19-2013, 12:08 PM
  3. WHERE clause
    By fabiobarreto10 in forum Forms
    Replies: 5
    Last Post: 04-12-2012, 02:42 PM
  4. Not In Clause
    By dukect in forum Queries
    Replies: 10
    Last Post: 08-29-2011, 04:55 PM
  5. IIF clause
    By Peljo in forum Queries
    Replies: 2
    Last Post: 02-05-2008, 11:22 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