| Author |
Topic |
|
RooHoo
Starting Member
11 Posts |
Posted - 2003-03-21 : 09:15:41
|
| I need to export a file with today's date added on to the name, ie.Disconnect_mmddyy.xls.In my CREATE TABLE for Access the code is"Disconnect_" & Format$(Now(), "mmddyy") & ".xls", FalseHow do you write it for SQL?Thanks |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2003-03-21 : 09:23:18
|
| Take a look at GETDATE() or current_timestampJay White{0} |
 |
|
|
RooHoo
Starting Member
11 Posts |
Posted - 2003-03-21 : 09:39:11
|
| This doesn't work,Can you give me the syntax, CREATE TABLE `DisconnectCompDaily`&`GetDate()` |
 |
|
|
RooHoo
Starting Member
11 Posts |
Posted - 2003-03-21 : 09:44:32
|
| When I try to export it out using the Excel icon, it makes you put a file name, which is what the file name will be, it doesn't take the new date on the end of it.Thanks |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2003-03-21 : 09:48:37
|
| Excel icon? What are you talking about? Are you trying to create a DTS package?To dynamically set source and destination connections in a dts package look hereJay White{0} |
 |
|
|
RooHoo
Starting Member
11 Posts |
Posted - 2003-03-21 : 10:00:00
|
| Yes, a DTS package.After I have my connection ICON, then do I put the ACTIVE script (with the code on the link you sent me) and then the excel icon?I know this is VERY basic for some of you, but for NEWBIES it is quite confusing.Thanks so much for all of you help! |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2003-03-21 : 10:09:16
|
| You really should consider buying a good book on DTS. IMHO, it is not very easy to work with and is quite confusing. nr will tell you to avoid it at all costs.Follow these steps.1.) Open a new dts package.2.) Create a Connection to you SQL Server.3.) Create a Connection to an excel spreadsheet (call it DisconnectCompDailyTest.xls for now)4.) Set up the transform data task and prove you can export from a table to excel.5.) Create an ActiveX Scripting Task using the code in the link to set the name of you excel spreadsheet at runtime.6.) Create a precedence constriant such that you ActiveX Scripting Task runs before your Transform Data Task.Jay White{0} |
 |
|
|
RooHoo
Starting Member
11 Posts |
Posted - 2003-03-21 : 13:24:50
|
| I have MS Step by Step SQL Server 2000 Programming. Is there a better one?Thanks for the code.Much appreciated! |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-03-21 : 14:21:08
|
| SQLTeam has a list of books that they recommend for SQL Server. Here is the one for DTS:[url]http://www.amazon.com/exec/obidos/ASIN/1861004419/sqlteamcom-20/002-3500965-1498427[/url]Tara |
 |
|
|
|