sql - Extract a specific line from a SELECT statement based on the last Trasanction date -
good day,
i have sql code return me quantities received on time, want display latest one
select * (select distinct [dbo].[ttcibd001110].[t_cmnf] [manufacturer], [dbo].[ttcibd001110].[t_item] [item code], [dbo].[ttcibd001110].[t_dsca] [description], [dbo].[ttcibd001110].[t_seak] [search key 1], [dbo].[twhinr110110].[t_trdt] [transaction date], [dbo].[twhinr110110].[t_cwar] [warehouse], [dbo].[twhinr110110].[t_qstk] [quantity inventory unit] [dbo].[twhinr110110] left join [dbo].[ttcibd001110] on [dbo].[twhinr110110].[t_item]=[dbo].[ttcibd001110].[t_item] [dbo].[twhinr110110].[t_koor]='2' , [dbo].[ttcibd001110].[t_cmnf]='manufacturerx') tabel ltrim(tabel.[item code])='1000045'
now, selection want select line latest transaction date, stuck.
can me in way?
thank you!
change beginning
select top 1
and after use
order [transaction date] desc
Comments
Post a Comment