I have a lot of SQL at work in MS-Access, and I need to formatted so that it's human readable. The issue is when I change between views I end up with the SQL being condensed down into something that I can't read.
How do I force SQL to retain its 'shape' when I go to other views?
Access opens the table in Datasheet view. Select the field (the column) that you want to change. On the Fields tab, in the Properties group, click the arrow in the drop-down list next to Data Type, and then select a data type. Save your changes.
To make queries run faster, you should have indexes on all fields in the query that join, restrict, or sort the data. Whenever possible, link on Primary Key fields instead of other fields. Indexes are most critical on tables with large numbers of records, so you may not see a difference on small tables.
I found a hack, here. The secret lies in enclosing your query inside a dummy query. Like so:
SELECT * FROM (SELECT <-----here
Table1.Field1,
Table1.Field2
FROM
Table1
WHERE
Table1.Field2 = "Yes") AS query1 <-----here
I've indicated where and how you wrap the code. The only issue I can see is if you wanted to edit the code in design view, then it doesn't seem to pick the enclosed code up at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With