MyDanes
asked on
Sqlserver 2005 query syntax help
I have
+ convert(varchar(10), getdate(), 112)
which is part of a concantonated query
it yields:
20080625
for its piece
I need it to show:
062508
Thanks in advance
+ convert(varchar(10), getdate(), 112)
which is part of a concantonated query
it yields:
20080625
for its piece
I need it to show:
062508
Thanks in advance
SELECT REPLACE (CONVERT(varchar(10),getda te(),1),'/ ','')
ASKER
Ok that did not work I got an error - I should have put the entire section which is:
select top 100 percent '2',right('0000000000' + cast(payment_id as varchar(10)),10) +
right('0000000000' + replace(cast(amount as varchar(10)),'.',''),10) + '355008765102873' + convert(varchar(10), getdate(),10),'-','') as result
from CASHMGMT_PAYMENT
ONLY need to fix the getdate part so my output for the getdate portion shows:
062508
select top 100 percent '2',right('0000000000' + cast(payment_id as varchar(10)),10) +
right('0000000000' + replace(cast(amount as varchar(10)),'.',''),10) + '355008765102873' + convert(varchar(10), getdate(),10),'-','') as result
from CASHMGMT_PAYMENT
ONLY need to fix the getdate part so my output for the getdate portion shows:
062508
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
huh? why did you pick that one over mine? your syntax was wrong in your 2nd post.
OK. You just had me confused....thought I had answered something wrong. :)
ASKER
Thanks Chapmando and sorry for the trouble
select replace(convert(varchar(10