473,503 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is wrong with this statement

2 New Member
Very inexperienced in Access, trying to make a change to the order data pulls on a form. Made a change and now I am getting an error. What is wrong with this? TIA
Expand|Select|Wrap|Line Numbers
  1. SELECT  [ShipmentDetails-SelectPO].[Date Shipped] & "   " & [ShipmentDetails-SelectPO].POID, AS Expr1, [ShipmentDetails-SelectPO].[PO] FROM [ShipmentDetails-SelectPO] ORDER BY [ShipmentDetails-SelectPO].[PO];
Apr 13 '18 #1
5 1306
jns42
3 New Member
You have an unnecessary ',' character before the "AS Expr1" statement.
Apr 13 '18 #2
stacy08
2 New Member
jns42 Thank you! I removed that character and now I am getting a different error: This expression is typed incorrectly or is too complex to be evaluated.......
Apr 13 '18 #3
jns42
3 New Member
I'm not actually an Access expert, but in general T-SQL terms...

It looks like you've also listed the source table twice - once before and once after the "FROM" clause. Try:

Expand|Select|Wrap|Line Numbers
  1. SELECT [ShipmentDetails-SelectPO].[Date Shipped] & " " & [ShipmentDetails-SelectPO].POID AS Expr1 FROM [ShipmentDetails-SelectPO] ORDER BY [ShipmentDetails-SelectPO].[PO]
I've also removed the ending ';' character - Not sure if Access requires them.
Apr 13 '18 #4
twinnyfo
3,653 Recognized Expert Moderator Specialist
stacy08,

Welcome to Bytes!

I'd be glad to help with this. However, in your second post, you do not tell us the error you are receiving. The type of error you receive helps us guide our response.

Also, the final ";" is standard SQL syntax, and always a good idea to include.

Thanks for the clarification.
Apr 13 '18 #5
NeoPa
32,557 Recognized Expert Moderator MVP
Hi Stacy.

Following on from the good advice you've already received, it helps to format your SQL in such a way as to be easily readable, and it helps to repost it after changes have been made. We can only assume you've followed the guidance accurately, and often that isn't the case.

Here are some other tips for debugging SQL strings (How to Debug SQL String).

PS. Welcome to Bytes.com for both Stacy08 AND jns42.

PPS. The semi-colon (;) is perfectly acceptable when dealing with Jet/ACE SQL in Access. It isn't necessary though. Access will assume one if not there and multiple SQL statements are not acceptable in Jet/ACE SQL anyway, so it's not as important as in other environments.
Apr 14 '18 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2330
by: Jay Wolfe | last post by:
Hi, I came across this statement and it has a confusing element. I know the whole '?:" construct and the assignment within the compare, but what's up with the comma? All the variables here are...
2
1972
by: Frank | last post by:
I am reading other people's code and come across this statement. Does it mean phase revolve arround 0,1,2 and 3 & 3 makes 0? Thank you. phase = 0; for (i = 0; i <= 100; i++) {...
3
2206
by: Teeravee Sirinapasawasdee | last post by:
I found this method code in Enterprise Library 2.0 and I really don't have idea what does it mean. public virtual void SetParameterValue(DbCommand command, string parameterName, object value) {...
4
2006
by: riceyeh | last post by:
Hi, When reading the source code of dojo, it uses the following statement quite often. What does it mean? What I do not understand is it has a function definition enclosed in a pair of parenthesis...
1
1317
by: Readon Shaw | last post by:
return &dhcpInit; where dhcpInit() is a function decleared before. would dhcpInit be called?
6
2114
by: raghu | last post by:
Hello This is raghu. And I want to know about the meaning of the statement given below log_txt( __FILE__, __LINE__, ##argList); in above statement what does FILE ,LINE ##argList mean. I want to...
2
1320
by: Rocky86 | last post by:
hi plss help I need to noe what this php code is doing while($row = mysql_fetch_array($resultpostal)) { $temp=$row; } foreach($temp as $key=>$extract) ...
6
1999
by: CTG | last post by:
"update set UPDATE-FLAG=false, UPDATE-DT= '10/09/2007 4:09:59 PM' WHERE ICCID='I1' " UPDATE_FLAG is a YES/NO ICCID is TEXT I have tried YES, NO as well but still fails,
1
2291
by: paras shah | last post by:
just had the above question as an interview question, couldn really answer, there is no code under while loop, but just wat does the above code do ?? does it compare or wat?
1
1580
by: amer sohail | last post by:
add(b1); b1.addActionListner(this);
0
7198
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7072
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...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5570
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
373
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.