Hey guys. I'm doing my neighbor a favor and helping with her home business.
I'm new to sql and im trying to use a sql statement, but it is to long for one line. I dont know how to break it up into multiple lines without getting a compile error.
PS. The problem is the select line, it on it's own is too long. Some help would be great! - SELECT [Current Orders].Cust_Order_No, [Current Orders].New, [Current Orders].Buyer, [Current Orders].Brand, [Current Orders].Wine, [Current Orders].Vintage, [Current Orders].Qty, [Current Orders].Pack_Size, [Current Orders].Price, [Current Orders].Discount, [price]*[QTY] AS [Gross Price], [Gross Price]*[discount] AS [Nett Price1], [GROSS PRICE]-[NETT PRICE1] AS [NETT PRICE2], TblBuyer.Terms, TblBuyer.[Inco Term], TblBuyer.Freight_M, TblBuyer.Currency1, TblBuyer.Currency2, TblBuyer.[Account No], TblBuyer.Country, TblBuyer.Acc_Cust_Address1, TblBuyer.AC_Tel1, TblBuyer.AC_Tel2, TblBuyer.AC_Tel3, TblBuyer.AC_Fax1, TblBuyer.AC_Email1, TblBuyer.AC_Email2, TblBuyer.AC_Email3, TblBuyer.Del_Address1, TblBuyer.Del_Address2, TblBuyer.Del_Address3, TblBuyer.Del_Address4, TblBuyer.Cust_Notes, TblCurrency.[Banking Details], TblCurrency.Notes, [Current Orders].Est_DOS, [Current Orders].Inv_No, "APW0" & [inv_No] AS [Document No], TblBuyer.Terms_temp, TblBuyer.Inv_Notes, TblBuyer.Equipment, TblBuyer.[Load Instruction], TblBuyer.Courier_Details, TblBuyer.Contact_Cust, TblBuyer.Tel_Cust, TblBuyer.Contact_Courier, TblBuyer.Tel_Courier, TblBuyer.Contact_Consignee, TblBuyer.Tel_Consignee, TblBuyer.[Agent Involved], TblBuyer.POD, TblBuyer.[Final Destination], TblBuyer.Insulation, TblBuyer.[Documentation Requirements], [Current Orders].[Container No], [Current Orders].[Seal No], [Current Orders].Invoice_Date, TblBuyer.VATNo
-
FROM [Current Orders] INNER JOIN (TblCurrency INNER JOIN TblBuyer ON TblCurrency.Currency = TblBuyer.Currency1) ON [Current Orders].Buyer = TblBuyer.Buyer
-
WHERE ((([Current Orders].Inv_No)=[Please enter the invoice no]));
I'm not sure whether you are talking about SQL here or VBA. SQL needs no special handling of broken lines as it recognises only general white-space. VBA on the other hand requires the underscore (_) character to indicate continuation between lines.
As an illustration I'll post your SQL reformatted so that it is more readable. There is no change to the effect of the SQL : - SELECT [Current Orders].Cust_Order_No
-
, [Current Orders].New
-
, [Current Orders].Buyer
-
, [Current Orders].Brand
-
, [Current Orders].Wine
-
, [Current Orders].Vintage
-
, [Current Orders].Qty
-
, [Current Orders].Pack_Size
-
, [Current Orders].Price
-
, [Current Orders].Discount
-
, [price]*[QTY] AS [Gross Price]
-
, [Gross Price]*[discount] AS [Nett Price1]
-
, [GROSS PRICE]-[NETT PRICE1] AS [NETT PRICE2]
-
, TblBuyer.Terms
-
, TblBuyer.[Inco Term]
-
, TblBuyer.Freight_M
-
, TblBuyer.Currency1
-
, TblBuyer.Currency2
-
, TblBuyer.[Account No]
-
, TblBuyer.Country
-
, TblBuyer.Acc_Cust_Address1
-
, TblBuyer.AC_Tel1
-
, TblBuyer.AC_Tel2
-
, TblBuyer.AC_Tel3
-
, TblBuyer.AC_Fax1
-
, TblBuyer.AC_Email1
-
, TblBuyer.AC_Email2
-
, TblBuyer.AC_Email3
-
, TblBuyer.Del_Address1
-
, TblBuyer.Del_Address2
-
, TblBuyer.Del_Address3
-
, TblBuyer.Del_Address4
-
, TblBuyer.Cust_Notes
-
, TblCurrency.[Banking Details]
-
, TblCurrency.Notes
-
, [Current Orders].Est_DOS
-
, [Current Orders].Inv_No
-
, "APW0" & [inv_No] AS [Document No]
-
, TblBuyer.Terms_temp
-
, TblBuyer.Inv_Notes
-
, TblBuyer.Equipment
-
, TblBuyer.[Load Instruction]
-
, TblBuyer.Courier_Details
-
, TblBuyer.Contact_Cust
-
, TblBuyer.Tel_Cust
-
, TblBuyer.Contact_Courier
-
, TblBuyer.Tel_Courier
-
, TblBuyer.Contact_Consignee
-
, TblBuyer.Tel_Consignee
-
, TblBuyer.[Agent Involved]
-
, TblBuyer.POD
-
, TblBuyer.[Final Destination]
-
, TblBuyer.Insulation
-
, TblBuyer.[Documentation Requirements]
-
, [Current Orders].[Container No]
-
, [Current Orders].[Seal No]
-
, [Current Orders].Invoice_Date
-
, TblBuyer.VATNo
-
FROM [Current Orders] INNER JOIN
-
(TblCurrency INNER JOIN TblBuyer
-
ON TblCurrency.Currency = TblBuyer.Currency1)
-
ON [Current Orders].Buyer = TblBuyer.Buyer
-
WHERE ((([Current Orders].Inv_No)=[Please enter the invoice no]));
Welcome to Bytes!
2 4431
Aaah, im getting to tired. Don't worry. Solved. Had '&_' instead of '& _'
NeoPa 32,556
Expert Mod 16PB
I'm not sure whether you are talking about SQL here or VBA. SQL needs no special handling of broken lines as it recognises only general white-space. VBA on the other hand requires the underscore (_) character to indicate continuation between lines.
As an illustration I'll post your SQL reformatted so that it is more readable. There is no change to the effect of the SQL : - SELECT [Current Orders].Cust_Order_No
-
, [Current Orders].New
-
, [Current Orders].Buyer
-
, [Current Orders].Brand
-
, [Current Orders].Wine
-
, [Current Orders].Vintage
-
, [Current Orders].Qty
-
, [Current Orders].Pack_Size
-
, [Current Orders].Price
-
, [Current Orders].Discount
-
, [price]*[QTY] AS [Gross Price]
-
, [Gross Price]*[discount] AS [Nett Price1]
-
, [GROSS PRICE]-[NETT PRICE1] AS [NETT PRICE2]
-
, TblBuyer.Terms
-
, TblBuyer.[Inco Term]
-
, TblBuyer.Freight_M
-
, TblBuyer.Currency1
-
, TblBuyer.Currency2
-
, TblBuyer.[Account No]
-
, TblBuyer.Country
-
, TblBuyer.Acc_Cust_Address1
-
, TblBuyer.AC_Tel1
-
, TblBuyer.AC_Tel2
-
, TblBuyer.AC_Tel3
-
, TblBuyer.AC_Fax1
-
, TblBuyer.AC_Email1
-
, TblBuyer.AC_Email2
-
, TblBuyer.AC_Email3
-
, TblBuyer.Del_Address1
-
, TblBuyer.Del_Address2
-
, TblBuyer.Del_Address3
-
, TblBuyer.Del_Address4
-
, TblBuyer.Cust_Notes
-
, TblCurrency.[Banking Details]
-
, TblCurrency.Notes
-
, [Current Orders].Est_DOS
-
, [Current Orders].Inv_No
-
, "APW0" & [inv_No] AS [Document No]
-
, TblBuyer.Terms_temp
-
, TblBuyer.Inv_Notes
-
, TblBuyer.Equipment
-
, TblBuyer.[Load Instruction]
-
, TblBuyer.Courier_Details
-
, TblBuyer.Contact_Cust
-
, TblBuyer.Tel_Cust
-
, TblBuyer.Contact_Courier
-
, TblBuyer.Tel_Courier
-
, TblBuyer.Contact_Consignee
-
, TblBuyer.Tel_Consignee
-
, TblBuyer.[Agent Involved]
-
, TblBuyer.POD
-
, TblBuyer.[Final Destination]
-
, TblBuyer.Insulation
-
, TblBuyer.[Documentation Requirements]
-
, [Current Orders].[Container No]
-
, [Current Orders].[Seal No]
-
, [Current Orders].Invoice_Date
-
, TblBuyer.VATNo
-
FROM [Current Orders] INNER JOIN
-
(TblCurrency INNER JOIN TblBuyer
-
ON TblCurrency.Currency = TblBuyer.Currency1)
-
ON [Current Orders].Buyer = TblBuyer.Buyer
-
WHERE ((([Current Orders].Inv_No)=[Please enter the invoice no]));
Welcome to Bytes!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: JStrauss |
last post by:
Hello,
Can anybody give me some tips on the best and/or easiest way to display
multiple lines in a field. The data is collected from a "textarea" field
when the form is submitted, and I want to...
|
by: Wow |
last post by:
Do I have to replace all new lines with \n and document.write one line? Is
there something like perl's print lines
print << 'body';
body
in javascripts?
|
by: michael |
last post by:
Hi all,
i want to know how to display multiple lines in one crystal report chart in
asp.net
i wrote some codes but it always display 2 lines in separate chart(please
refer to the codes...
|
by: tshad |
last post by:
I have a textbox that I am storing as text (or as a varChar). The field has
multiple lines in it (not wrapped).
When I read it back into a multiline textbox, it works fine. But when I
read it...
|
by: George |
last post by:
Dear colleagues,
I refer to your help with specific graphic problem. It is
necessary to create a viewfinder in graphic application.
It seems that the algorithm is simple: just draw lines
in...
|
by: Loading name... |
last post by:
hey
asp.net 2.0
In my db (sql server 2005) I have a record which consist of multiple lines:
"HEY
THIS IS A TEST
OF MULTIPLE
LINES"
|
by: =?Utf-8?B?TG9zdEluTUQ=?= |
last post by:
Hi All :)
I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView.
True DBGrid has a MultipleLines property that controls whether individual
records span multiple lines. Is...
|
by: chitta |
last post by:
Hi I have a problem when i am looping on multiple lines.
the question as follows
If OrderProductLineItem (DocType='OrderCreate'/'OrderChange') < OrderProductLineItem...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |