guys unsaon man pag display sa date from database to VB like for example i want to input date from "may" to "june" daun if mag search ana na specific date then it will only diaplay from may to june how pls,,,,... help..
![]()
guys unsaon man pag display sa date from database to VB like for example i want to input date from "may" to "june" daun if mag search ana na specific date then it will only diaplay from may to june how pls,,,,... help..
![]()
bro,
unsa imong database?
Things that you should do to retrieve the records that you want:
1) You have to connect to the database
2) You have to create a query and use the date as your qualifier in your query
3) If you already retrieved the records, format the date using FORMAT function
* establish a connection to the database (if Oracle database use OO4O and use PL/SQL server side programming and if not Oracle use ADODC)
* create a procedure that will be called to populate recs from database
using your date range.
have a nice day!![]()
its all in the sql query string, you are retrieving from the database
if your using sqlserver as ur back end ur sql statement might look like this:
entrydate is my date field and DTP2, DTP3 is my datepickerCode:str1 = "Select ID,Entrynumber,Entrydate,Syscreator,Syscreated,Remarks,Status " str2 = "from vfimerchandiserhdr " str3 = "where Entrydate >= '" & DTP2.value & "' and Entrydate <= '" & Format(DTP3.value, "mm/dd/yyyy 23:59:00") & "' order by entrynumber"
if your using access as ur back end ur sql statement might look like this:
this snippet comes from one of my vb6 customized program for a company......hope it is useful to youCode:str1 = "select * from dataheader " str2 = "where status = false and TransactionDate >= #" & DTP2.Value & "# and TransactionDate <= #" & Format(DTP3.Value, "mm/dd/yyyy 23:59:00") & " #"
select id_no, firstname, lastname, birth_date
from emp
where birth_date between to_date('varFrom','MM-DD-YYYY') and to_date('varTo','MM-DD-YYYY')
/* your CreateDynaset method here */
do
/* populate grid here (assuming that your object is a grid)*/
loop
/* close dynaset here */
as simple as that...
Similar Threads |
|