4
Answers

help(advice) for select records from database

HI,

I need help(advice). I have small c# application and I use access database.

In my database i have tblData which looks like this

-------------------------------------------------
id-int ai |id_article int |qua double|date date/time|
-------------------------------------------------
1         |    1            |     0        |   28.02.2011  |
-------------------------------------------------


The records of this table every day will be incresed about 100 records more.
Now my problem is how to select this records, becouse for 4-5 monts i will have Thousands of records.

now i select records using following sql command:

 sql_kom = "SELECT Table2.Name,Table2.Price,tblData.qua,tblData.date,tblData.id FROM tblData INNER JOIN Table2 ON tblData.id_article = Table2.id WHERE tblData.date>#" + date_from + "# AND Prodazbi.date<#" + date_to + "# AND Table2.group='2'";


I don't know how smart solution is to create new table for every month and insert/read records from that table.

Sorry for my bad english :).
Answers (4)
0
Laxmidhar Sahoo
NA 2.3k 1.4k 7y
<b> Report Date:&nbsp;&nbsp; 2016-11-21 &nbsp;&nbsp;Optometrist: &nbsp;&nbsp;start &nbsp;&nbsp;Time:&nbsp;&nbsp; Consultant: &nbsp;&nbsp;Dr.suresh</b>
0
Midhun T P
NA 19.7k 281.2k 7y
Hi,
 
Please try below query - 
  1. DECLARE @x XML = '<table WIDTH="100%" CELLPADDING="1" CELLSPACING="1">  
  2.    
  3. <tr style="COLOR: black; FONT-FAMILY: Arial; FONT-SIZE: 10pt;BACKGROUND-COLOR: #f2f2f2;">  
  4.    <td><b>Report Date : </b>2016-11-21 </td>  
  5.   <td><b>Optometrist : </b> </td>  
  6.   <td><b>Start Time : </b> </td>  
  7. </tr>  
  8.    
  9. <tr style="COLOR: black; FONT-FAMILY: Arial; FONT-SIZE: 10pt;BACKGROUND-COLOR: #f2f2f2;">  
  10.         <td><b>Consultant : </b>Dr.Suresh </td>  
  11. </tr>  
  12.    
  13. </table>'  
  14.   
  15. SELECT t.c.value('.''NVARCHAR(MAX)')  
  16. FROM @x.nodes('*') t(c)  
 
Reference :
https://stackoverflow.com/questions/38868364/sql-remove-all-html-tags-in-a-string