Skip to main content
deleted 2 characters in body
Source Link
Deepak
  • 195
  • 3
  • 6
  • 17

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 | Date |Inserted_Date | Eligibilility|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.

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 | Date  | Eligibilility| +----+---------------+--------------+--------------+ | 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.

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.

edited tags; edited title
Link
Strawberry
  • 34k
  • 14
  • 43
  • 57

how to write a query based on its coulmncolumn

Source Link
Deepak
  • 195
  • 3
  • 6
  • 17

how to write a query based on its coulmn

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 | Date | Eligibilility| +----+---------------+--------------+--------------+ | 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.