473,545 Members | 937 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with displaying records between two dates

56 New Member
hello everyone,
I have a problem with displaying records between two dates.Below is my designing page:

start date: combobox of month(smonth) & combobox of year(syear)
end date : combobox of month(emonth) & combobox of year(eyear)

I want the records between this month and year.i have written the below query for that:

suppose,
smonth=01,emont h=08,syear=2000 ,eyear=2005
$q1="select transaction_id from transaction_mas ter where month BETWEEN '$smonth' AND '$emonth' and year BETWEEN '$syear' AND '$eyear'";

But with this query it is not displaying the record of 11/04/2004(mm/dd/yy).

i have used the below query also for that purpose:

$d1='01';
$d2='31';
$date1=$smonth. "/".$d1."/".$syear;
$date2=$emonth. "/".$d2."/".$eyear;
$sql="select distinct charity_id from transaction_mas ter where redeem_date BETWEEN '$date1' AND '$date2'";

But it displays the whole records of that table.
Please suggest me the solution of this problem.
please help me on this.

Thanks in advance.
Feb 28 '08 #1
5 1941
ronverdonk
4,258 Recognized Expert Specialist
smonth=01,emont h=08,syear=2000 ,eyear=2005
$q1="select transaction_id from transaction_mas ter where month BETWEEN '$smonth' AND '$emonth' and year BETWEEN '$syear' AND '$eyear'";
and what is, according to you, the data type and value of table field 'month' and table field 'year'?

Ronald
Feb 28 '08 #2
sejal17
56 New Member
thanx for your reply
but i have got the solution of it.thank u very much.
Mar 1 '08 #3
ronverdonk
4,258 Recognized Expert Specialist
thanx for your reply
but i have got the solution of it.thank u very much.
Could you share that solution with our members? So we can learn from your experience.

Ronald
Mar 1 '08 #4
sejal17
56 New Member
hii
i have written 3 queries.
1.select distinct charity_id from transaction_mas ter where y='$syear' and m>='$smonth';
2.$startyear=$s year + 1;
$endyear=$eyear - 1;
select distinct charity_id from transaction_mas ter where y BETWEEN '$startyear' AND '$endyear'';
forloop for every month.
for($i=0;$i<12; $i++)
3.select distinct charity_id from transaction_mas ter where y='$eyear' and m<='$emonth';
Mar 3 '08 #5
ronverdonk
4,258 Recognized Expert Specialist
Thanks for your explanation. See you again some time.

Ronald
Mar 3 '08 #6

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

Similar topics

3
5457
by: Kidus Yared | last post by:
I am having a problem displaying Unicode characters on my Forms labels and buttons. After coding Button1.Text = unicode; where the unicode is a Unicode character or string (‘\u1234’ or “\u1234”) It seems to work the first time I set the button to the Unicode character. After a while, when saving my code, I get a pop-up window stating...
0
1717
by: Fronky | last post by:
Hope someone can help. I am still learning, so no laughing please. I am displaying records from a database using Response.Write(""); instead of the usual datagrid method. I am doing it this way to achieve the result I require. However. Since I have added a button to the screen, and have had to include the "object sender, System.EventArgs...
3
1509
by: active | last post by:
I draw text in a bitmap and then draw the bitmap on a picturebox and get text that is not all displayed the same. Note the different text style in the (40, 100) area. Got any insight into what is happening? Cal
4
1689
by: jkuruvil | last post by:
I need to print a report of a bunch of records that falls between certain dates. Some records have dates and some don't. I did a UNION query to look for everything that falls between these two dates and everything that have NULL in date fields. Records get sorted in an ascending order. So, now I do see all the records, but I like to display...
0
1129
by: hali | last post by:
Hi all I'm working on jsf & I have a problem displaying a list of Items via hand set my code is: <wap:dataTable value="#{predefinedESP.esps}" var="esp" > <wap:column > <waputputText value="{esp.currentText}"/> </wap:column> <wap:dataTable> my problem is that the list of Items displayed in one long line and I need it to display each...
0
1454
by: John Kirkpatrick | last post by:
Hi all, I am having difficulty displaying records on a frontend MS Access 2000 form using a MySQL backend. The following code works well with the Jet database engine but doesn't work properly using the MySQL backend database. All records are displayed on the form using the Jet, but only one record appears using MySQL. Perhaps it just needs some...
1
1338
by: santhosh309 | last post by:
iam displaying records in gridview,now my requirement is based on the transaction i want to show that rows in a different colour
2
1662
by: mwgjr | last post by:
Problem displaying a graphics form from another forms button click event without losing the XY data plot. If the Startup form is the GraphWindow form the Graphlib.vb calls create a XY data plot. Code outline (not everything included): (Sub GraphWindow_Paint(ByVal sender As Object, ByVal e As SysPaintEventArgs) _ Handles Me.Paint) Call...
0
7467
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7419
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7756
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5326
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4944
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
703
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.