4
Answers

How to Query a SQL table with Months Range

<table border="0" cellpadding="0" cellspacing="0" width="459" style="border-collapse: collapse;344pt"> <colgroup><col width="64" style="48pt"> <col width="75" style="userset;2742;56pt"> <col width="64" span="5" style="48pt"> </colgroup><tbody><tr height="20" style="userset;15.0pt"> <td colspan="7" rowspan="3" height="60" width="459" style=" .5pt solid black;45.0pt;344pt">I have a sql table that have data store in this format, I want to extract data from March 2014 to Feburary 2015, how can I achive this please.</td> </tr> <tr height="20" style="15.0pt"> </tr> <tr height="20" style="15.0pt"> </tr> <tr height="21" style="15.75pt"> <td height="21" style="15.75pt;none">ID</td> <td style="none;none">Months</td> <td style="none;none">Years</td> <td style="none;none">fd1</td> <td style="none;none">fd2</td> <td style="none;none">fd3</td> <td style="none;none">fd4</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">1</td> <td style="none;none">january</td> <td align="right" style="none;none">2014</td> <td align="right" style="none;none">1</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">3</td> <td align="right" style="none;none">8</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">2</td> <td style="none;none">february</td> <td align="right" style="none;none">2014</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">5</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">3</td> <td style="none;none">march</td> <td align="right" style="none;none">2014</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">5</td> <td align="right" style="none;none">3</td> <td align="right" style="none;none">5</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">4</td> <td style="none;none">april</td> <td align="right" style="none;none">2014</td> <td align="right" style="none;none">3</td> <td align="right" style="none;none">4</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">2</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">5</td> <td style="none;none">may</td> <td align="right" style="none;none">2014</td> <td align="right" style="none;none">4</td> <td align="right" style="none;none">1</td> <td align="right" style="none;none">3</td> <td align="right" style="none;none">2</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">6</td> <td style="none;none">june</td> <td align="right" style="none;none">2014</td> <td align="right" style="none;none">1</td> <td align="right" style="none;none">1</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">2</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">7</td> <td style="none;none">july</td> <td align="right" style="none;none">2014</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">3</td> <td align="right" style="none;none">3</td> <td align="right" style="none;none">4</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">8</td> <td style="none;none">august</td> <td align="right" style="none;none">2014</td> <td align="right" style="none;none">5</td> <td align="right" style="none;none">6</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">5</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">9</td> <td style="none;none">september</td> <td align="right" style="none;none">2014</td> <td align="right" style="none;none">12</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">5</td> <td align="right" style="none;none">6</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">10</td> <td style="none;none">october</td> <td align="right" style="none;none">2014</td> <td align="right" style="none;none">11</td> <td align="right" style="none;none">1</td> <td align="right" style="none;none">5</td> <td align="right" style="none;none">3</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">11</td> <td style="none;none">november</td> <td align="right" style="none;none">2014</td> <td align="right" style="none;none">1</td> <td align="right" style="none;none">5</td> <td align="right" style="none;none">5</td> <td align="right" style="none;none">7</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">12</td> <td style="none;none">december</td> <td align="right" style="none;none">2014</td> <td align="right" style="none;none">3</td> <td align="right" style="none;none">8</td> <td align="right" style="none;none">5</td> <td align="right" style="none;none">8</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">13</td> <td style="none;none">january</td> <td align="right" style="none;none">2015</td> <td align="right" style="none;none">4</td> <td align="right" style="none;none">1</td> <td align="right" style="none;none">8</td> <td align="right" style="none;none">1</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">14</td> <td style="none;none">february</td> <td align="right" style="none;none">2015</td> <td align="right" style="none;none">5</td> <td align="right" style="none;none">9</td> <td align="right" style="none;none">8</td> <td align="right" style="none;none">4</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">15</td> <td style="none;none">march</td> <td align="right" style="none;none">2015</td> <td align="right" style="none;none">6</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">5</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">16</td> <td style="none;none">april</td> <td align="right" style="none;none">2015</td> <td align="right" style="none;none">6</td> <td align="right" style="none;none">5</td> <td align="right" style="none;none">20</td> <td align="right" style="none;none">2</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">17</td> <td style="none;none">may</td> <td align="right" style="none;none">2015</td> <td align="right" style="none;none">6</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">2</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">18</td> <td style="none;none">june</td> <td align="right" style="none;none">2015</td> <td align="right" style="none;none">9</td> <td align="right" style="none;none">5</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">2</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">19</td> <td style="none;none">july</td> <td align="right" style="none;none">2015</td> <td align="right" style="none;none">10</td> <td align="right" style="none;none">6</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">2</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">20</td> <td style="none;none">august</td> <td align="right" style="none;none">2015</td> <td align="right" style="none;none">12</td> <td align="right" style="none;none">3</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">5</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">21</td> <td style="none;none">september</td> <td align="right" style="none;none">2015</td> <td align="right" style="none;none">55</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">2</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">22</td> <td style="none;none">october</td> <td align="right" style="none;none">2015</td> <td align="right" style="none;none">1</td> <td align="right" style="none;none">1</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">5</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">23</td> <td style="none;none">november</td> <td align="right" style="none;none">2015</td> <td align="right" style="none;none">3</td> <td align="right" style="none;none">5</td> <td align="right" style="none;none">5</td> <td align="right" style="none;none">2</td> </tr> <tr height="20" style="15.0pt"> <td height="20" align="right" style="15.0pt;none">24</td> <td style="none;none">december</td> <td align="right" style="none;none">2015</td> <td align="right" style="none;none">2</td> <td align="right" style="none;none">5</td> <td align="right" style="none;none">5</td> <td align="right" style="none;none">5</td> </tr></tbody></table>
Answers (4)