I keep getting bad syntax next to the @Bdate and @edate, I doint see where the there is a syntax proble. For reference the pkpro..artran and pro30..artran are tables from different databases. Thanks in advance.
CREATE PROCEDURE spArtran
@bdate as smalldatetime(4)
@edate as smalldatetime(4)
AS
select t1.invno, t1.item, t1.custno, t1.cost, t1.price, t1.qytord, t1.qtyshp, t1.invdte, t1.extprice, t1.salesmn, t1.disc, t1.disc2, t1.disc3, t1.unitax, t1.taxitem from pkpro..artran as t1 where invdte between @bdate and @edate
union all
select t2.invno, t2.item, t2.custno, t2.cost, t2.price, t2.qytord, t2.qtyshp, t2.invdte, t2.extprice, t2.salesmn, t2.disc, t2.disc2, t2.disc3, t2.unitax, t2.taxitem from pro30..artran as t2 where invdte between @bdate and @edate
order by invno
GO
Software Engineer
Team Lead
damn bill gates, he has everything
CREATE PROCEDURE spArtran
@bdate as smalldatetime(4)
@edate as smalldatetime(4)
AS
select t1.invno, t1.item, t1.custno, t1.cost, t1.price, t1.qytord, t1.qtyshp, t1.invdte, t1.extprice, t1.salesmn, t1.disc, t1.disc2, t1.disc3, t1.unitax, t1.taxitem from pkpro..artran as t1 where invdte between @bdate and @edate
union all
select t2.invno, t2.item, t2.custno, t2.cost, t2.price, t2.qytord, t2.qtyshp, t2.invdte, t2.extprice, t2.salesmn, t2.disc, t2.disc2, t2.disc3, t2.unitax, t2.taxitem from pro30..artran as t2 where invdte between @bdate and @edate
order by invno
GO
Software Engineer
Team Lead
damn bill gates, he has everything