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
Exchange on Windows Server 2008 R2
Workflow: Update List Item using multiple "find" criteria
windows 7 ultimate drivers
How to change background html element when focus and lost focus?
Creating a comma separated list as a Function to be used in a Totals/Group By query
ActiveX and VB.Net 2005
Copying multiple user selected records to a recordset
Script to read and ping default gateway needs an enhancement
Differences between CREATE TYPE and sp_addtype
Detect how cmd script started