mama gdk try bt wede hari giye nethi nisai help akak illanna hhithuwe plz mata me query(SQL sever 2008) aka liyala dennako loku udwak Machanla
mekai wenna oni
table 2k thiyenawa loading and billitem
loading table ake lorrystock Column aken billitem table ake quntity Column aken adu karala dennakoo......
like this
(loading) (billitem)
lorrystock - quntity = result
15 - 10 = 5
13 - 9 = 4
menna create query aka
programing language vb.net
mekai wenna oni
table 2k thiyenawa loading and billitem

loading table ake lorrystock Column aken billitem table ake quntity Column aken adu karala dennakoo......
like this
(loading) (billitem)
lorrystock - quntity = result
15 - 10 = 5
13 - 9 = 4
menna create query aka
programing language vb.net

Code:
USE [sp]
GO
/****** Object: Table [dbo].[loading] Script Date: 02/12/2013 08:38:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[loading](
[itemcode] [real] NULL,
[itemname] [varchar](50) NULL,
[Loading] [real] NULL,
[unloading] [real] NULL,
[lorrystock] [real] NULL,
[lorry] [nchar](10) NULL,
[date] [date] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[loading] ([itemcode], [itemname], [Loading], [unloading], [lorrystock], [lorry], [date]) VALUES (5, N'Lemon Puff 100g', 5, 4, 15, N'Lorry 1 ', CAST(0xBB360B00 AS Date))
INSERT [dbo].[loading] ([itemcode], [itemname], [Loading], [unloading], [lorrystock], [lorry], [date]) VALUES (8, N'Milk Shorties 80g', 5, 1, 13, N'Lorry 1 ', CAST(0xBB360B00 AS Date))
/****** Object: Table [dbo].[billitem] Script Date: 02/12/2013 08:38:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[billitem](
[itemcode] [real] NULL,
[itemname] [varchar](50) NULL,
[quntity] [varchar](50) NULL,
[lorry] [varchar](50) NULL,
[date] [date] NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[billitem] ([itemcode], [itemname], [quntity], [lorry], [date]) VALUES (5, N'Lemon Puff 100g', N'10', N'Lorry 1 ', CAST(0xBB360B00 AS Date))
INSERT [dbo].[billitem] ([itemcode], [itemname], [quntity], [lorry], [date]) VALUES (8, N'Milk Shorties 80g', N'10', N'Lorry 1 ', CAST(0xBB360B00 AS Date))
Last edited: