![]() |
| ||
| SQL moving data error 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 & ")" |
| ||
| Re: SQL moving data error 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. |
| ||
| Re: SQL moving data error 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 & ")" |
| ||
| Re: SQL moving data error 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 & ")" |
| ||
| Re: SQL moving data error thanks, I must have forgotton the later [ marks. cheers |
| All times are GMT -4. The time now is 4:10 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC