Rabu, 12 Oktober 2011

Re: [MS_AccessPros] Syntactic limitations in an SQL UPDATE sentence

Thanks a lot John!
This saves me a lot of headache!
Dennis

12 okt 2011 kl. 10:04 skrev John Viescas:

> Dennis-
>
> The syntax looks OK, but the query will probably be declared not updatable. In
> native Access, you would write it like this:
>
> UPDATE TableA INNER JOIN TableB
> ON TableA.Field2 = TableB.Field2
> SET TableA.Field1 = TableB.Field1
>
> .. but Field2 would need to be the PKey of one of the two tables.
>
> John Viescas, author
> Microsoft Office Access 2010 Inside Out
> Microsoft Office Access 2007 Inside Out
> Building Microsoft Access Applications
> Microsoft Office Access 2003 Inside Out
> SQL Queries for Mere Mortals
> http://www.viescas.com/
> (Paris, France)
>
> -----Original Message-----
> From: MS_Access_Professionals@yahoogroups.com
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Dennis Davidsson
> Sent: Wednesday, October 12, 2011 9:32 AM
> To: MS_Access_Professionals@yahoogroups.com
> Subject: [MS_AccessPros] Syntactic limitations in an SQL UPDATE sentence
>
> Hello,
>
> I wonder if the following SQL sentence is syntactically valid in Access:
>
> UPDATE TableA
> SET Field1 = (SELECT Field1 FROM TableB
> WHERE TableB.Field2 = TableA.Field2)
> WHERE TableA.Field2 IN (SELECT Field2 FROM TableB)
>
> Regards
> Dennis Davidsson
>
>
> [Non-text portions of this message have been removed]
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>

[Non-text portions of this message have been removed]

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MS_Access_Professionals/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/MS_Access_Professionals/join
(Yahoo! ID required)

<*> To change settings via email:
MS_Access_Professionals-digest@yahoogroups.com
MS_Access_Professionals-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
MS_Access_Professionals-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

Tidak ada komentar:

Posting Komentar