Microsoft
Software
Hardware
Network
Question : SQL Rewrite this dateadd line
How can I name this with the date?
SELECT
@Day2 As DATEADD(DAY, -1, GetDate()),
The resulting field name I need - '01/21/2010'
with the data @Day2
Answer : SQL Rewrite this dateadd line
thats not possible without using a dynamic sql
DECLARE @Day2 DATETIME = Getdate()
DECLARE @sql VARCHAR(1000)
SET @sql = 'SELECT '+ CONVERT(VARCHAR, @Day2, 112) + 'As "'+ cast( DATEADD(DAY, -1, GetDate()) AS varchar) +'" '
EXEC (@sql)
Random Solutions
How to refresh a Tree View from another Form
activex can't create object solution, ahhh
Return recordset from Oracle via Linked Server and OPENQUERY
How do I retrieve text from a website
Can someone explain this code to me?
SQL 2005 Database Mail Fails When Sending Through Exchange 2003
Unable to uninstall Windows SharePoint Services
Tidy ways to handle multi-page forms in Access?
Query XML data in TSQL
Remote Desktop Keeps Launching Explorer