Re: Table with only the last record




"solar" <sprimerov@xxxxxxxxx> skrev i en meddelelse
news:1140971929.731838.23880@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In addition to my question I guess that i should build a make table
query that contains only the last order.To this end i have tried to
build the following function:
Public Function Alan()
Dim SQL As String
SQL = "SELECT * INTO orders1 FROM orders WHERE orders1.orderid =
DMax(orderid,orders)"
CurrentDb.Execute SQL
End Function

However i get the error "too few parameters".Where am i wrong and i can
i do in that way ?


How about:

SELECT * INTO orders1 FROM orders WHERE orderid = (SELECT MAX(orderid) FROM
orders)



.



Relevant Pages

  • Re: Highlight Records That Are In Use By Another User
    ... You need to operate your database using pessimistic locking and you need an extra table to track the locks per table. ... Public Function LockRecordAs Boolean ... Dim sql As String ... E.g. Win32 API GetUserNameA. ...
    (microsoft.public.access.modulesdaovba)
  • Re: COM+ Method level security problem
    ... Public Function CreateNewClientAs Integer ... Dim sql As String ... Dim NewID As Integer ... Public Function FetchClient(ByVal ClientID As Integer) ...
    (microsoft.public.dotnet.framework.component_services)
  • Re: Error 3075 (SQL Update Statement)
    ... Dim SQL as String ... Public Function SQLQuote(AString As String, ... SQLQuote = Replace(AString, ADelimiter, ADelimiter & ADelimiter) ...
    (microsoft.public.access.formscoding)
  • Re: Field Size: Integer to Double
    ... Public Function get_hrs(WOPRE As Double, WOSUF As Double) ... Dim sql As String ...
    (microsoft.public.access.gettingstarted)
  • Re: Field Size: Integer to Double
    ... They will not fire. ... dbFailOnError ... Public Function get_hrs ... Dim sql As String ...
    (microsoft.public.access.gettingstarted)