Forum Moderators: open

Message Too Old, No Replies

exporting asp table to excel

         

darrengan

9:14 am on Mar 19, 2004 (gmt 0)

10+ Year Member



Hie all,

This is rather a SQL question.
I got no problem exporting the data to excel file when i uses this query:

select * from table where user = smith

But when i uses "in" or "like" it will not work:

select * from table where user in ('smith','john')

select * from table where user like 'smi%'

Any solution to this?

Thanks in advance

txbakers

6:03 pm on Mar 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't understand your question. Both queries are valid. Are you not getting any data in the second query?

How are you exporting to Excel?

darrengan

2:07 am on Mar 22, 2004 (gmt 0)

10+ Year Member



Hie txbaker,

Thanks for your reply.

I am using standard source code:
Response.ContentType ="Application/vnd.excel"
Response.AddHeader "Content-Disposition", "attachment; filename=Excel.xls"

When using Ms Access, there is no problem exporting the data to Excel uses SQL "in" or "like". If i uses MsSql, this will not happen if i uses SQL "in" or "like". Is there any bugs in MsSql insupporting such query?

Thanks for your info.

Cheers