J
Jeff Dillon
So exactly where does it break?? If you remove the Order by? Can you order
by on other fields? Is Field3 really your field name? Not very descriptive.
by on other fields? Is Field3 really your field name? Not very descriptive.
Edwin Knoppert said:CREATE VIEW RESULT AS
SELECT *
FROM Table1
ORDER BY Field3;
Same result (error)
Edwin Knoppert said:I have not, will try tomorrow (Holland )
I'm using year and such in expressions, these go well though.
Jeff Dillon said:I assume you've tried other ORDER BY clauses that work ok? I believe YEAR
is a built-in Access function that you can't use. Did you try ORDER BY
Field3?
Jeff
OK Jeff, i worked it out, at the end it was easy to prepare an example.
Just create a table with a few fields + datefield (whatever).
When i add the ORDER BY clause it will not accept it..
CREATE VIEW RESULT AS
SELECT *
FROM Table1
ORDER BY Year(Field3);
I have posted the working example here:
http://www.hellobasic.com/trials/dbtest1.zip
I'm sure there are workarounds for this by making use of additional
querydefs but that's not really a goal is it?
ACCESS runs the select statement fine!
Extract the zip and use open website, run.
The EXECUTE accepts an execute query which will be used with a
tranaction and rollback.
"Jeff Dillon" <[email protected]> schreef in bericht
What? You create a simple example that works, and add your linked
tables until it works. Basic troubleshooting. Of course you need
everything, but you don't get there all at once!
Again, "where" does it break? Um, don't "forget" this time? That is
exactly what it causing your error (?? obviously?)
I already tried that (and forgot) but of course i can not have less.
Iow, it should accept 100%, maybe there is a know issue.
But on inet i found very little.
"Jeff Dillon" <[email protected]> schreef in bericht
Reduce the complexity until you find where it's breaking
To answer the responses so far:
This is an access MDB used in ASP.NET v2.0
The website is hosted by a webhosting company, we only have access
through ftp.
Yes, we have the project locally, i'm testing this create view
stuff locally.
The idea is that i need to write me complex queries, to complex for
me unless i prepare multiple querydefs (views) using each other.
To avoid downloading the database for maintanance i wanted to
insert new queries remote.
I'm just taking existing querydef's from the access database which
work(!) and try to create them using Execute() stuff.
'Simple' queries do get inserted, the example i shown does not..
???
I simply use an ASPX having a textbox being passed to the execute
command.
Liek i said, it works until it's getting complicated according the
error message i get.
"Edwin Knoppert" <[email protected]> schreef in bericht
I have serious issue by inserting a query using (names are fake):
CREATE VIEW Query1 AS
SELECT Count(Table1.ID) AS CountOfID, Day([DatumAanmaak]) AS Dag,
Month([DatumAanmaak]) AS Maand, Year([DatumAanmaak]) AS Jaar
FROM Table1
GROUP BY Day([DatumAanmaak]), Month([DatumAanmaak]),
Year([DatumAanmaak]), Day([DatumAanmaak]), Month([DatumAanmaak]),
Year([DatumAanmaak])
HAVING (((Year([DatumAanmaak]))=Year(Date())))
ORDER BY Year([DatumAanmaak]) DESC , Month([DatumAanmaak]) DESC ,
Day([DatumAanmaak]) DESC;
"Only simple SELECT queries are allowed in VIEWS."
Can this be solved?