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 2005 Forums
 Transact-SQL (2005)
 indirect query doubt on a table

Author  Topic 

vinod.meee
Starting Member

2 Posts

Posted - 2010-04-13 : 07:20:36
I have a payment table in my application. The members are supposed to pay a certain amount to a community every month from their joining. there is a payment table contains

memberid, date of the month for which payment has done(that is, if payment for march 2010 done on 12 March 2010 - the date will contain that date.), amount payed.

now i want to show the list of paid and payment pending monts of a purticular member. how can i do that using this tabke structure. do in need to change the table structure. can any one help me in this.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-13 : 08:45:56
nope. but you need a calendar table which you need to use as a base and then compare with above table to identify gaps in payment

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

vinod.meee
Starting Member

2 Posts

Posted - 2010-04-14 : 04:14:18
Can i get a sample code the this.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-14 : 04:28:46
sure. see below

http://visakhm.blogspot.com/2010/02/generating-calendar-table.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2010-04-14 : 04:51:09
quote:
Originally posted by visakh16

sure. see below

http://visakhm.blogspot.com/2010/02/generating-calendar-table.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/




Visakh,
in my office this is blocked as this is personal site can you please post the code for me....
Thanks

Vaibhav T

To walk FAST walk ALONE
To walk FAR walk TOGETHER
Go to Top of Page
   

- Advertisement -