Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 One to many problem

Author  Topic 

assiff79
Starting Member

7 Posts

Posted - 2014-03-06 : 11:44:21
i want last record in tbl_gold for each customerID in tbl_goldPure
tbl_customers is customerID, customerName,customerPhone
and 2nd table is
tbl_gold goldID, customerID, goldDebit, goldCredit,goldReceivableTotal.

asif

marcusn25
Yak Posting Veteran

56 Posts

Posted - 2014-03-06 : 17:23:57
Is there a date field for time stamping a record to the database upon creation?

Marcus

I learn something new everyday.
Go to Top of Page

assiff79
Starting Member

7 Posts

Posted - 2014-03-07 : 08:02:13
yeh two fields goldDate and goldDateTime

asif
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2014-03-07 : 11:13:56
What is the logic to determine which is the "last record (sic)?"
Go to Top of Page

assiff79
Starting Member

7 Posts

Posted - 2014-03-07 : 11:52:43
Actually i am keeping DebitWt and CreditWt. the last record is obtained after mathematical step of last record.The last record shows latest Debit Wt and latest Credit Wt and latest Receivable Wt.

asif
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2014-03-07 : 12:02:45
quote:
Originally posted by assiff79

i want last record in tbl_gold for each customerID in tbl_goldPure
tbl_customers is customerID, customerName,customerPhone
and 2nd table is
tbl_gold goldID, customerID, goldDebit, goldCredit,goldReceivableTotal.

asif



quote:
Originally posted by assiff79

Actually i am keeping DebitWt and CreditWt. the last record is obtained after mathematical step of last record.The last record shows latest Debit Wt and latest Credit Wt and latest Receivable Wt.

asif

I'm totally confused on how your last post relates to the original post.

Can you please read the links below on how to post your question so we can help you better:

http://www.sqlservercentral.com/articles/Best+Practices/61537/
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page
   

- Advertisement -