Results 1 to 3 of 3
  1. #1
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    Format of SQL Code

    When I right click the title bar of the window and click SQL View I see the SQL code as follows:

    SELECT Properties.[Property #], Properties.[Property Type], Properties.City, Properties.State, Properties.Bedrooms, Properties.Bathrooms, Properties.Condition, Properties.[Market Value]
    FROM Properties
    WHERE (((Properties.State)="VA")) OR (((Properties.State)="MD"));



    Now I would rather see it like it is shown so often in the literature and examples. That is:

    SELECT Properties.[Property #],
    Properties.[Property Type],
    Properties.City,
    Properties.State,
    Properties.Bedrooms,
    Properties.Bathrooms,
    Properties.Condition,
    Properties.[Market Value]
    FROM Properties1
    WHERE (((Properties.State)="VA")) OR (((Properties.State)="MD"));



    So is there a way to change the format to the latter type which I prefer.

    Any help appreciated. Thanks in advance.




    Respectfully,


    Lou Reed

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Nothing native in Access.
    You could write a function to do some reformatting.

    You could use this to do some slight modification to layout. But it isn't part of Access.

    It will convert this
    Code:
    SELECT Properties.[Property #], Properties.[Property Type], 
    Properties.City, Properties.State, Properties.Bedrooms, 
    Properties.Bathrooms, Properties.Condition, Properties.[Market Value]
    
    FROM Properties
    
    WHERE (((Properties.State)="VA")) OR (((Properties.State)="MD"));


    to this
    Code:
    SELECT Properties.[Property #]
    	,Properties.[Property Type]
    	,Properties.City
    	,Properties.STATE
    	,Properties.Bedrooms
    	,Properties.Bathrooms
    	,Properties.Condition
    	,Properties.[Market Value]
    FROM Properties
    WHERE (((Properties.STATE) = "VA"))
    	OR (((Properties.STATE) = "MD"));

  3. #3
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Thanks I will try it.

    Respectfully,

    Lou Reed

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

Similar Threads

  1. Replies: 0
    Last Post: 10-07-2013, 09:37 AM
  2. Replies: 4
    Last Post: 08-28-2013, 05:20 PM
  3. Replies: 0
    Last Post: 08-13-2013, 09:35 PM
  4. Replies: 5
    Last Post: 01-29-2013, 07:58 PM
  5. Code issue on Format of label
    By Gavroche in forum Reports
    Replies: 2
    Last Post: 09-14-2011, 06:19 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