Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert date to yyyymmdd without time 1

Status
Not open for further replies.

Rob7

Programmer
Dec 12, 2001
152
US
Hello All,

This is my procedure. I have looked at books on line but cannot see where the Convert command is actually supposed to go. Thanks in advance.

Rob

Declare @Date1 as DateTime

Set @Date1 = getdate()


INSERT INTO maccat.dbo.INTERFACE_PO

SELECT Data_03.dbo.POORDLIN_SQL.ord_no,
Data_03.dbo.POORDLIN_SQL.line_no,
Data_03.dbo.POORDLIN_SQL.vend_no,
Data_03.dbo.APVENFIL_SQL.vend_name,
Data_03.dbo.APVENFIL_SQL.vend_type_cd,
Data_03.dbo.POORDLIN_SQL.item_no,
Data_03.dbo.POORDLIN_SQL.item_desc_1,
Data_03.dbo.IMITMIDX_SQL.prod_cat,
Data_03.dbo.POORDLIN_SQL.stk_loc,
Data_03.dbo.POORDLIN_SQL.qty_ordered,
Data_03.dbo.POORDLIN_SQL.request_dt,
Data_03.dbo.POORDHDR_SQL.user_def_fld_1,
@Date1

FROM Data_03.dbo.POORDLIN_SQL INNER JOIN
Data_03.dbo.APVENFIL_SQL ON Data_03.dbo.POORDLIN_SQL.vend_no = Data_03.dbo.APVENFIL_SQL.vend_no INNER JOIN
Data_03.dbo.POORDHDR_SQL ON Data_03.dbo.POORDLIN_SQL.ord_no = Data_03.dbo.POORDHDR_SQL.ord_no INNER JOIN
Data_03.dbo.IMITMIDX_SQL ON Data_03.dbo.POORDLIN_SQL.item_no = Data_03.dbo.IMITMIDX_SQL.item_no


WHERE (Data_03.dbo.POORDLIN_SQL.stk_loc = 'CK' OR
Data_03.dbo.POORDLIN_SQL.stk_loc = 'CLK') AND (Data_03.dbo.POORDLIN_SQL.path_no <> '1')





Cytec Corporation
rbrown@cyteccorp.com
 
I think all you need to change is only modify
select .....
Data_03.dbo.POORDHDR_SQL.user_def_fld_1,
@Date1
to
select .....
Data_03.dbo.POORDHDR_SQL.user_def_fld_1,
convert(varchar(11),@Date1,112)


 
That was it. Thanks so much.

Cytec Corporation
rbrown@cyteccorp.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top