I have a table named TableA, as below;
+----+---------------+--------------+--------------+ | Id | Frequency | Inserted_Date| Eligibility | +----+---------------+--------------+--------------+ | 1 | Halfyearly | 23/8/2013 | | | 2 | Quaterly | 24/11/2013 | | +----+---------------+--------------+--------------+
Here Eligibility column is initially empty.I need to write a query where Eligibility is set to be yes /no based on the frequency for current month.
for 1st record, as of today Eligibility=No
for 2nd record, as of today Eligibility=Yes
+----+---------------+--------------+--------------+ | Id | Frequency |Inserted_Date | Eligibility| +----+---------------+--------------+--------------+ | 1 | Halfyearly | 23/8/2013 | No | | 2 | Quaterly | 24/11/2013 | Yes | +----+---------------+--------------+--------------+
I have no idea how to write a query for getting the above output and more over i need to change it for every month.
Please help me out.
Thank you all in advance for your response.
Eligibilility. In fact, I can't tell what the table represents either.2013-01-01and Frequency wasHalfyearly, thenEligibility = 1if current month isJan 2013, Jul 2013, Jan 2014, Jul 2014 etc..