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
Laptop Problems
Me.Visible AND Me.WIndowState = WindowState.Normal doesn't work
IE8 home page is being forced to google.co.uk
Repadmin to verify replication?
Call NetMessageBufferSend function from vb.net
AD Login Script not working on Windows 7 - but will run locally from same computer
Complicated Select & Insert statement - MS SQL 2008
How to supress 'Access denied' when copy/replace file in the System folder using Command Prompt
Why does GetModuleFileName return long names sometimes, and mangled names sometimes (WinNT)?
Automatic resizing of forms and text boxes