Home > Archive > MS SQL Server > November 2006 > SQL Server doesnt like my syntax









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SQL Server doesnt like my syntax
p.macrae@gmail.com

2006-11-30, 12:12 am

I have previously used this:

sqlPrefix = "(Int(tbl_Jobs.Number/1000) = " & Me!cboPrefix.Column(0) &
")"

for use in a drop down selection filter. I've just changed to SQL
Server 2005 and it wants nothing to do with this. I followed the
upsizing whitepaper and tried just swapping it out like this:

' sqlPrefix = "(floor(tbl_Jobs.Number/1000) = " &
Me!cboPrefix.Column(0) & ")"

and it still doesnt like it. It says:

Incorrect Syntax near ')'

Anyone see what I did wrong?

John Bell

2006-11-30, 7:14 pm

Hi

You should look at the whole statement rather than just part once everything
is concatenated i.e what does Me!cboPrefix.Column(0) return as it may need
enquoting.

' sqlPrefix = "(floor([tbl_Jobs].[Number]/1000) = [" &
Me!cboPrefix.Column(0) & "] )"

Also it could be useful to post DDL and example data if it is needed.

John

"p.macrae@gmail.com" wrote:

> I have previously used this:
>
> sqlPrefix = "(Int(tbl_Jobs.Number/1000) = " & Me!cboPrefix.Column(0) &
> ")"
>
> for use in a drop down selection filter. I've just changed to SQL
> Server 2005 and it wants nothing to do with this. I followed the
> upsizing whitepaper and tried just swapping it out like this:
>
> ' sqlPrefix = "(floor(tbl_Jobs.Number/1000) = " &
> Me!cboPrefix.Column(0) & ")"
>
> and it still doesnt like it. It says:
>
> Incorrect Syntax near ')'
>
> Anyone see what I did wrong?
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com