Ask a Question related to ASP Database, Design and Development.
-
HallMonitor89 #1
Access 2k SQL Statement
I am trying to get the SQL statement right for querying an Access 2k
database
I would like to obtain the first record of Event A and the last record
of Event B of each day.
This is what I have for a query. When I run it, I get "Syntax Error
(Missing Operator)in query expression LAST [Table].[Event]" (Table name
has been changed to protect the guilty)
SELECT TOP 1 [Table].[Event], [Table].[Customer], [Table].[Date&Time]
FROM Table
WHERE ((([Table].[Event])="FirstEvent") And
(([Table].[Customer])="ACME") And
(([Table].[Date&Time])=DateValue("December 15, 2003")))
UNION SELECT LAST [Table].[Event], [Table].[Customer],
[Table].[Date&Time]
FROM Table
WHERE ((([Table].[Event])="Final") And (([Table].[Customer])="ACME") And
(([Table].[Date&Time])=DateValue("December 15, 2003")))
ORDER BY [Table].[Date&Time];
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
HallMonitor89 Guest
-
Having Problems With SQL Statement[ACCESS DB]
Hi, This is my SQL Procedure : IFF(21 in(SELECT PageID FROM TBL_Trafic WHERE PageID=21), (UPDATE TBL_Trafic SET Hits=Hits+1,... -
Show Access DB-content with i.e. WHEN-statement??
I have a database with an autoincrement ID-column and a ParentID-column. Its used in a sort of "thread-environment" When a new thread is... -
access insert statement
have you tried? was there an error? I'm not sure that Access has the "@@identity".... I'd suggest trying and posting the specific errors. --... -
pass sql where statement into access report
I am trying to automate production of an Access report via ASP. I have almost got there apart from the fact that I want to send either an SQL... -
Statement Conversion Access -> mySQL
SQL = "DELETE FROM table WHERE ID IN (1, 9, 15, 20)" The above statement is for deleting records in access using checkboxes on a form (deletes... -
Ray at #2
Re: Access 2k SQL Statement
Try:
LAST([Table].[Event])
or also use TOP 1 in conjuction with ORDER BY something DESC
Ray at home
"HallMonitor89" <nospam@novirus.com> wrote in message
news:OPX3ccPxDHA.1364@tk2msftngp13.phx.gbl...>
>
> I am trying to get the SQL statement right for querying an Access 2k
> database
>
> I would like to obtain the first record of Event A and the last record
> of Event B of each day.
>
> This is what I have for a query. When I run it, I get "Syntax Error
> (Missing Operator)in query expression LAST [Table].[Event]" (Table name
> has been changed to protect the guilty)
>
> SELECT TOP 1 [Table].[Event], [Table].[Customer], [Table].[Date&Time]
> FROM Table
> WHERE ((([Table].[Event])="FirstEvent") And
> (([Table].[Customer])="ACME") And
> (([Table].[Date&Time])=DateValue("December 15, 2003")))
> UNION SELECT LAST [Table].[Event], [Table].[Customer],
> [Table].[Date&Time]
> FROM Table
> WHERE ((([Table].[Event])="Final") And (([Table].[Customer])="ACME") And
> (([Table].[Date&Time])=DateValue("December 15, 2003")))
> ORDER BY [Table].[Date&Time];
>
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Ray at Guest



Reply With Quote

