RSS Forums RSS
Please support our MS Access and FileMaker Pro advertiser: Programming Forums
Views: 305 | Replies: 4 | Solved | Thread Tools  Display Modes
Reply
Join Date: Nov 2008
Posts: 19
Reputation: Swarv is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Swarv Swarv is offline Offline
Newbie Poster

SQL moving data error

  #1  
Dec 1st, 2008
Hi all,

I have this sql line (below) and where it works fine at the moment. But I have columns with 2 words i.e. opened by. I would like to add this colum to the statement below but everytime i try it errors. Do I have to reword the statement or use special quotes?

Thanks

Martin


SQLText = "INSERT INTO issues1 ([title], [time], [Opened], [staff], [status], [category], [comment]) SELECT title, time, Opened, staff, status, category, comment " & "FROM issues where (issues.id=" & Me.ID & ")"
Last edited by peter_budo : Dec 3rd, 2008 at 7:17 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2007
Posts: 172
Reputation: timothybard is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 16
timothybard's Avatar
timothybard timothybard is offline Offline
Junior Poster

Re: SQL moving data error

  #2  
Dec 1st, 2008
Can you show us the statement that doesn't work? My first guess would be that you don't have brackets around each of the fields. I see you have brackets in the Insert INTO section of the SQL Statement, but not in the SELECT section of the statement.
Reply With Quote  
Join Date: Nov 2008
Posts: 19
Reputation: Swarv is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Swarv Swarv is offline Offline
Newbie Poster

Re: SQL moving data error

  #3  
Dec 1st, 2008
The statement above does work. I would have thought that the below would work. All I would do is place the column names in quotes.

SQLText = "INSERT INTO issues1 ("title", "time", "Opened", "opened by", "staff", "status", "category", "comment", "assigned to") SELECT title, time, Opened, opened by, staff, status, category, comment , assigned to" & "FROM issues where (issues.id=" & Me.ID & ")"
Last edited by peter_budo : Dec 3rd, 2008 at 7:18 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote  
Join Date: Mar 2007
Posts: 172
Reputation: timothybard is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 16
timothybard's Avatar
timothybard timothybard is offline Offline
Junior Poster

Re: SQL moving data error

  #4  
Dec 1st, 2008
Try this:

SQLText = "INSERT INTO issues1 ([title], [time], [Opened], [opened by], [staff], [status], [category], [comment], [assigned to]) SELECT [title], [time], [Opened], [opened by], [staff], [status], [category], [comment] , [assigned to]" & "FROM issues where (issues.id=" & Me.ID & ")"
Reply With Quote  
Join Date: Nov 2008
Posts: 19
Reputation: Swarv is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Swarv Swarv is offline Offline
Newbie Poster

Re: SQL moving data error

  #5  
Dec 1st, 2008
thanks, I must have forgotton the later [ marks.

cheers
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the MS Access and FileMaker Pro Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 9:06 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC