dbTalk Databases Forums  

How can I have a field be output to excel in a hyperlink

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss How can I have a field be output to excel in a hyperlink in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Russell
 
Posts: n/a

Default How can I have a field be output to excel in a hyperlink - 11-01-2004 , 05:58 AM






I am using the select statement to pull data out of the database and into an
excel file via dts. Is there anyway to make 'Log File' appear as a hyperlink
in the resulting spread sheet?

select s.sch_id,
'Date Scheduled'=convert(varchar(17),s.sch_date,113),
s.e_subject,
'Number Processed'=(select count(dl.sch_id) from distribution_list dl where
dl.sch_id = s.sch_id and dl.delivery_status=2),
'Total Number'=(select count(dl.sch_id) from distribution_list dl where
dl.sch_id = s.sch_id),
'Log file'= '\\Renown\eNewsletters\Logs\SE\'+
convert(varchar(12),getdate(),112) +'.log'
from schedule s
where s.sch_id=518
order by s.sch_id

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: How can I have a field be output to excel in a hyperlink - 11-01-2004 , 12:57 PM






AFAIK that would be a Front End setting as it sounds like the cell itself
would need to be formatted like that Wouldn't it?

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"Russell" <Russell (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am using the select statement to pull data out of the database and into
an
excel file via dts. Is there anyway to make 'Log File' appear as a
hyperlink
in the resulting spread sheet?

select s.sch_id,
'Date Scheduled'=convert(varchar(17),s.sch_date,113),
s.e_subject,
'Number Processed'=(select count(dl.sch_id) from distribution_list dl
where
dl.sch_id = s.sch_id and dl.delivery_status=2),
'Total Number'=(select count(dl.sch_id) from distribution_list dl where
dl.sch_id = s.sch_id),
'Log file'= '\\Renown\eNewsletters\Logs\SE\'+
convert(varchar(12),getdate(),112) +'.log'
from schedule s
where s.sch_id=518
order by s.sch_id



Reply With Quote
  #3  
Old   
Ed Enstrom
 
Posts: n/a

Default Re: How can I have a field be output to excel in a hyperlink - 11-01-2004 , 08:11 PM



"Russell" <Russell (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am using the select statement to pull data out of the database and into
an
excel file via dts. Is there anyway to make 'Log File' appear as a
hyperlink
in the resulting spread sheet?
If you find out how to do this, I would like to know too. I am trying to do
the same thing.
I am building a string in my SELECT statement similar to the following (from
Excel help):
=HYPERLINK("http://example.microsoft.com/report/budget report.xls", "Click
for report")

The string is inserted into the cell properly, but Excel puts a single quote
at the beginning and doesn't recognize it as a function. If I open the
workbook and manually remove the leading single quote and press "Enter",
Excel recognizes the hyperlink. I am considering writing a VBA macro to
step through the worksheet and remove the leading quotes, but I am not very
proficient in VBA and would rather do it directly in the datapump task if
possible.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.