0

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 & ")"
2
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by Swarv
0

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.

0

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 & ")"
0

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 & ")"
0

thanks, I must have forgotton the later [ marks.

cheers

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.