SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 One to many problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

assiff79
Starting Member

Pakistan
7 Posts

Posted - 03/06/2014 :  11:44:21  Show Profile  Reply with Quote
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
Starting Member

Germany
39 Posts

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

Marcus

I learn something new everyday.

Edited by - marcusn25 on 03/06/2014 17:24:20
Go to Top of Page

assiff79
Starting Member

Pakistan
7 Posts

Posted - 03/07/2014 :  08:02:13  Show Profile  Reply with Quote
yeh two fields goldDate and goldDateTime

asif
Go to Top of Page

Lamprey
Flowing Fount of Yak Knowledge

4608 Posts

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

assiff79
Starting Member

Pakistan
7 Posts

Posted - 03/07/2014 :  11:52:43  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

4608 Posts

Posted - 03/07/2014 :  12:02:45  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000