Snailspace
Board Regular
- Joined
- Jan 28, 2009
- Messages
- 56
I think I may have bitten off a bit more than I can chew here.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
I’m trying to create a SQL string to pull in information from two csv files.<o></o>
The following works as [Acc No], [Doc No] are in the Open_Invoices file and [Due_Date] is only in the Disputed_Invoices file.<o></o>
<o></o>
<o></o>
However if I try to use joins, or query fields with the same name I’m struggling to get a code that works. I guess it doesn’t like the additional “.” Between the file name & the csv part.<o></o>
Thanks for your time.
<o></o>
I’m trying to create a SQL string to pull in information from two csv files.<o></o>
The following works as [Acc No], [Doc No] are in the Open_Invoices file and [Due_Date] is only in the Disputed_Invoices file.<o></o>
Rich (BB code):
'works on both files<o:p></o:p>
' SQL_OpenItems = "SELECT [Acc No], [Doc No], [Due_Date]" & _<o:p></o:p>
' " FROM Open_Invoices.csv, disputed_invoices.csv" & _<o:p></o:p>
' " WHERE [Acc No]='" & UCase(frm1_AccMain.txtAccNo.Value) & "'"<o:p></o:p>
<o></o>
However if I try to use joins, or query fields with the same name I’m struggling to get a code that works. I guess it doesn’t like the additional “.” Between the file name & the csv part.<o></o>
Rich (BB code):
‘errors<o:p></o:p>
'SQL_OpenItems = "Select [Acc No], [Doc No],[Due_Date] " & _<o:p></o:p>
' " FROM open_Invoices.csv LEFT JOIN Disputed_Invoices.csv " & _<o:p></o:p>
' " ON open_Invoices.[Doc No] = Disputed_Invoices.[Inv_No]" & _<o:p></o:p>
' " WHERE [Acc No]='" & UCase(frm1_AccMain.txtAccNo.Value) & "'"<o:p></o:p>
Thanks for your time.