Kamis, 20 Agustus 2015

Re: [MS_AccessPros] Need Syntax help please.

 

CustomerGroup([Cust]))="""CNF"""));"

Sent from Outlook




On Thu, Aug 20, 2015 at 1:07 PM -0700, "winberry.doyce@roadsysinc.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:



Friends, I can't seem to get the syntax right on this SQL statement. I've tried various combinations of #, & and " around the where line but can't get it to run. I'm trying to insert records into a table using a start date and end date parameters from a form. Also I get nothing in the immediate window when I type ?startdate or ?enddate or ?strSQLCredit.


Dim strSQLCredit As String
    Dim StartDate As Date
    Dim EndDate As Date
   
    StartDate = Me.Start_Date
    EndDate = Me.End_Date


strSQLCredit = "INSERT INTO tblInterCoTemp ( Account, Credit, Line_Descripton, Invoice ) " & vbCrLf & _
                   "SELECT Manual_Invoice_Detail.Account, ([Qty]*[Price]) AS Credit, [Manual_Invoice_Detail]![Invoice] & "" "" & [Manual_Invoice_Detail]![Description] & "" ("" & [Qty] & "")"" AS [Line Description], Manual_Invoice_Detail.Invoice " & vbCrLf & _
                   "FROM Manual_Invoice_Header INNER JOIN Manual_Invoice_Detail ON Manual_Invoice_Header.Invoice = Manual_Invoice_Detail.Invoice " & vbCrLf & _
                   "WHERE (((Manual_Invoice_Detail.[Account])<>0) AND ((Manual_Invoice_Header.[Invoice Date]) Between #StartDate# And #EndDate# AND ((CustomerGroup([Cust]))=""CNF""));"


Doyce





__._,_.___

Posted by: Duane Hookom <duanehookom@hotmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)

.

__,_._,___

Tidak ada komentar:

Posting Komentar