Where to post SQL questions?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need the URL for posting questions re SQL. like:

what is the syntax to construct a datetime value form month and year stored in integer variables and a day constant, such as

@w-datetime = @MM + '01' + @yy

thanks,
 
try microsoft.public.sqlserver.programming

DECLARE @MM int
DECLARE @yy int
SET @MM = 8
SET @yy = 2004

DECLARE @w smalldatetime

IF @MM <10
SET @w = CAST(CAST(@yy AS VARCHAR(4)) + '0' + CAST(@MM AS VARCHAR(2))+
'01' AS smalldatetime)
ELSE
SET @w = CAST(CAST(@yy AS VARCHAR(4)) + CAST(@MM AS VARCHAR(2))+ '01' AS
smalldatetime)

PRINT @w

probably not very robust

HTH,
Greg


walker said:
I need the URL for posting questions re SQL. like:

what is the syntax to construct a datetime value form month and year
stored in integer variables and a day constant, such as
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top