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: 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)
  • updating
    ... etc amd i have to repeat 12 times my update query as: ... Public Function UpdateTableProducts1() ... Dim sql As String ...
    (microsoft.public.access.modulesdaovba)

Loading