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
Event 10016, DistributedCOM
Video examples for Inner join with 2 databases
Applying Adobe patch with a .msp file using Group Policy
Convert Epoch Date from Mysql to MS Access
select the most recent date in mssql
How to disable nested triggers in a SQL statement
How to make label in vb.net visual studio 2008 Transparent
Upgrading Server 2008 Evaluation Version to Fully Licensed
VB.net opening text file into DataGridView
2 questions about messagequeue