Link to home
Start Free TrialLog in
Avatar of MyDanes
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
Avatar of chapmandew
chapmandew
Flag of United States of America image


select replace(convert(varchar(10), getdate(),10),'-','')
Avatar of sbagireddi
sbagireddi

SELECT REPLACE (CONVERT(varchar(10),getdate(),1),'/','')
Avatar of MyDanes

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

ASKER CERTIFIED SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.  :)
Avatar of MyDanes

ASKER

Thanks Chapmando and sorry for the trouble