Tables-
srno
assignto
status
devicetype
subdevicetype
SerialNumber
installedby
installeddate
1
A
S1
Desktop
Monitor
123ser
D
1-jan-2017
2
C
S2
Laptop
456dty
2-jan-2017
3
S4
789juk
3-jan-2017
4
E
S5
4-jan-2017
serialnumber
createdon
3-dec-2016
Step-2 –
Load all details – where srno is greater in tblasset table –
Output as –
Logic – For SerialNumber - 789juk, there is one record in tblasset table, with srno=3.
For SerialNumber -456dty, there are two records and max srno is = 4.
For each serial number, find the largest srno in tblasset table and fetch those records.
Status
srnoOfAssetTable
Query-
Select a.srno, a assignto ,a.Device, a.SubDevice, a.SerialNumber,a.Status
From
(
Select asset.srno, asset.assignto, asset.status, asset.devicetype, asset.subdevice, asset.installedby, asset.installeddate, lotentry.serialnumber, lotentry.PONO, lotentry.hostname,
Row_number()over (partition by lotentry.serialnumber order by asset.dtcreatedby desc)rn
From tblassets asset, tblSerialNumberMaster lotentry
Where asset.serialnumber = lotentryserialnumber
)a
Where rn = 1
Step-2-
Load this data in gridview.
Against each record, user will enter price, remarks and price – multiple times.
Srno
price
remarks
filename
30
test
F
1-feb-2017
44
G
55
62
g
5
41
6
34
Again-
Step -4 –
Load these records on gridview such that –
Eg – For SerialNumber -123ser, there are two entries in the table, (srno – 3,4). Latest entry is srno-4; so load the record srno-4;
Same, for SerialNumner - 789juk, there are two entries in table ,(srno – 1,6). Latest entry is srno – 6; so load the record srno -5;
In short, I have to display two different records in two different gridviews.
Please help me out in Step-4