Directly into SQL view (1 Viewer)

geister

New member
Local time
Yesterday, 23:09
Joined
Jan 16, 2017
Messages
9
Is there any way to open up SQL view directly?
 

geister

New member
Local time
Yesterday, 23:09
Joined
Jan 16, 2017
Messages
9
SQL view in Access.

And to load it up directly without using the Query Wizard or Query Design.
 

sxschech

Registered User.
Local time
Yesterday, 23:09
Joined
Mar 2, 2010
Messages
792
Not that I'm aware of. You can create a generic query in SQL and save that. Then when you want to create a new query, open the generic in design view and overwrite the existing sql statement and do a save as (or copy the existing query to a new name and then open it in design view).

To set up the generic query for the first time:
Create new query, go to design view click on SQL
Paste in exactly as shown:
Code:
SELECT * FROM X;
Save it as qrySQL (or whatever you want to call it to remind you that it is a generic sql query.
 

geister

New member
Local time
Yesterday, 23:09
Joined
Jan 16, 2017
Messages
9
Not that I'm aware of. You can create a generic query in SQL and save that. Then when you want to create a new query, open the generic in design view and overwrite the existing sql statement and do a save as (or copy the existing query to a new name and then open it in design view).

To set up the generic query for the first time:
Create new query, go to design view click on SQL
Paste in exactly as shown:
Code:
SELECT * FROM X;
Save it as qrySQL (or whatever you want to call it to remind you that it is a generic sql query.

Thank you, this makes sense. It is a shame there is no direct button, but this is close enough.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:09
Joined
Aug 30, 2003
Messages
36,125
Not sure why geister's posts keep getting moderated, but I've approved them. Reformed spammer maybe? :p
 

geister

New member
Local time
Yesterday, 23:09
Joined
Jan 16, 2017
Messages
9
Not sure why geister's posts keep getting moderated, but I've approved them. Reformed spammer maybe? :p

Not sure myself, I do use a VPN so sometimes sites don't like that.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:09
Joined
Jul 9, 2003
Messages
16,278
Not sure myself, I do use a VPN so sometimes sites don't like that.

Due to a bug in the forum software this message was "unapproved" (hidden) for some considerable time. I have just approved it. I hope no one has been inconvenience too much! The new forum software no longer has this bug, so this problem should not reoccur.
 

zeroaccess

Active member
Local time
Today, 01:09
Joined
Jan 30, 2020
Messages
671
When I save and close a query while in SQL view, the next time I open it in Design, it opens instead in SQL. Try it.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 16:09
Joined
Jan 20, 2009
Messages
12,851
Access often trashes the SQL layout so it is pretty horrible for complex queries.
One way to make Access leave it alone is to add this at the end of the query.
UNION ALL SELECT Null, Null ..... FROM DummyTable.

Include as many Nulls as there are fields in the main query.
DummyTable is just any table with no records.

The query will always open in SQL View and Access won't trash the layout.

The UNION may make the query run slow or be not updateable so I sometimes keep the SQL with the UNION just for editing and paste the rest of it into another query just for running it where I don't care what Access does with the layout.
 

Users who are viewing this thread

Top Bottom