james_lankford
Well-known Member
- Joined
- Jan 11, 2009
- Messages
- 1,223
I write a bunch of queries using straight sql, without the query designer
I'll write the query, run it, save the query
everything's fine
then I come back a week later to run the query again (except this time I want to change the "order by" or maybe change one thing in the "where")
so I open the query in sql view and ...
half the time it opens all nice and pretty, just the way I wrote it, just the way I saved it
and half the time it opens like this
WHY WHY WHY does it do that !!!
I cannot figure out why it sometimes keeps the formatting and why sometimes it doesn't
it's gotten to the point where I don't even save my queries in access anymore
I just save them a text file and open, copy, paste when I need them
I'll write the query, run it, save the query
everything's fine
then I come back a week later to run the query again (except this time I want to change the "order by" or maybe change one thing in the "where")
so I open the query in sql view and ...
half the time it opens all nice and pretty, just the way I wrote it, just the way I saved it
Code:
select
field1,
field2
count(*) as number_of
from
some_table
as tbl
where
(
(
tbl.field3 = "x"
)
and
(
tbl.field4 = "y"
)
)
group by
field1,
field2
and half the time it opens like this
Code:
select field1, field2 count(*) as number_of from some_table as tbl where ((tbl.field3="x") and (tbl.field4="y")) group by field1, field2
WHY WHY WHY does it do that !!!
I cannot figure out why it sometimes keeps the formatting and why sometimes it doesn't
it's gotten to the point where I don't even save my queries in access anymore
I just save them a text file and open, copy, paste when I need them