473,382 Members | 1,258 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

how to display report for specific date

2
i have made a software for medicine distributor
i wanna show the reports for orders placed to a pharmaceutical company within specific period of time
i wrote
rs.Open "Select * from placedorder where PLACE_DATE between " & Txtdate.Text & " and " & txtdateto.Text & " ", con, 3, 3


but im getting all records from the db being displayed during run time ,
but
i want records between specific date that user enters during run time
so please any one help me out with the query
Apr 16 '07 #1
3 1478
Killer42
8,435 Expert 8TB
I believe the problem is probably related to the delimiters (or lack of them) around your date values. See this reference, and this one may also be of some use.
Apr 17 '07 #2
cmrhema
375 256MB
i have made a software for medicine distributor
i wanna show the reports for orders placed to a pharmaceutical company within specific period of time
i wrote
rs.Open "Select * from placedorder where PLACE_DATE between " & Txtdate.Text & " and " & txtdateto.Text & " ", con, 3, 3


but im getting all records from the db being displayed during run time ,
but
i want records between specific date that user enters during run time
so please any one help me out with the query
I assume that your backend is MS-Access.
Secondly you have to format your textbox to date format, Better use DtPicker control
Then put down the query as
rs.Open "Select * from placedorder where PLACE_DATE >=#" & DTPicker1.Value & "# and PLACE_DATE<=# " & DTPicker2.Value & "# ",con, adOpenDynamic, adLockOptimistic


In case your backend is sql server replace # with '
Good luck
Apr 17 '07 #3
Killer42
8,435 Expert 8TB
I think the SQL is neater and slightly easier to read if you use the Between keyword, as in the original code. Not that it would make any difference to the functionality, of course.
Apr 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Glenn P. | last post by:
Sorry, CDMA, I searched this NG on several combinations of words, but I didn't find a relevant hit, so here's my newbie question: I have an Access 2002 table which contains data extracted from...
1
by: Glenn P. | last post by:
Sorry, CDMA, I searched this NG on several combinations of words, but I didn't find a relevant hit, so here's my newbie question: I have an Access 2002 table which contains data extracted from...
1
by: bruce24444 | last post by:
First of all I'm new to the forum and am working on my first database. So far I think I've done not too bad but have hit a stumbling block for which I'm not sure how to get around. What I have is...
0
by: keithsimpson3973 | last post by:
Does anyone know if it is possible to display the value of a date picker control on a vb6 form that the user selected on an access report? I am using vb6 to display a report selection and it has a...
0
by: keithsimpson3973 | last post by:
Does anyone know if it is possible to display the value of a date picker control on a vb6 form that the user selected on an access report? I am using vb6 to display a report selection and it has a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.