By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,790 Members | 1,430 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,790 IT Pros & Developers. It's quick & easy.

What is wrong with this statement

P: 2
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
Share this Question
Share on Google+
5 Replies

P: 3
You have an unnecessary ',' character before the "AS Expr1" statement.
Apr 13 '18 #2

P: 2
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

P: 3
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

Expert Mod 2.5K+
P: 3,205

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

Expert Mod 15k+
P: 31,418
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 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

Post your reply

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