By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,504 Members | 1,410 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,504 IT Pros & Developers. It's quick & easy.

to construct query to find the report for a month

P: 7
Hai



Pls help me to write a query



I am having a table with name stock

Which contains fields:

Serialno,pdate,pname,quantity,unitprice , total

Serialno->number

Pdate->purchasedate(date/time)

Pname-> Product name(Text)

Quantity->Quantity(Number)

Unitprice->unitprice(number)

Total-> Total(Number)

I want to construct query to find the report for a month
Jul 15 '07 #1
Share this Question
Share on Google+
5 Replies


P: 49
Hai



Pls help me to write a query



I am having a table with name stock

Which contains fields:

Serialno,pdate,pname,quantity,unitprice , total

Serialno->number

Pdate->purchasedate(date/time)

Pname-> Product name(Text)

Quantity->Quantity(Number)

Unitprice->unitprice(number)

Total-> Total(Number)

I want to construct query to find the report for a month
.............................

OK Assuming that you know how to build a query through the wizard is best fro pople new to Access.
Having created the query in CRITERIA beneath the Pdate place:

Between [fromdate] And [end_date]


save the query

create a REPORT from the query then when you run the report you'll be asked for the from - to dates you want to interigate. Put in the date from and to date and away to go. Plus this way you can even interigate weeks, days, years whichever way you feel you want it.


Hope this of some help
Gareth
Jul 15 '07 #2

P: 65
Hai



Pls help me to write a query



I am having a table with name stock

Which contains fields:

Serialno,pdate,pname,quantity,unitprice , total

Serialno->number

Pdate->purchasedate(date/time)

Pname-> Product name(Text)

Quantity->Quantity(Number)

Unitprice->unitprice(number)

Total-> Total(Number)

I want to construct query to find the report for a month
Try this sql statement:
Select * from stock where Pdate=<the date you want>
<the date you want> maybe also be taken from a text box.

Hope this will assist
Jul 16 '07 #3

hariharanmca
100+
P: 1,977
Try this sql statement:
Select * from stock where Pdate=<the date you want>
<the date you want> maybe also be taken from a text box.

Hope this will assist
getting date value in text box is no good Practice.
Jul 16 '07 #4

P: 7
hai hariharan
i am having the above query with using two dates taken from user. i am searching for a different answer.
using two textboxes i also think is not a godd pratice

getting date value in text box is no good Practice.
Jul 16 '07 #5

hariharanmca
100+
P: 1,977
hai hariharan
i am having the above query with using two dates taken from user. i am searching for a different answer.
using two textboxes i also think is not a godd pratice

I think this will help you

Query String :

Expand|Select|Wrap|Line Numbers
  1. “Select <StringField1>, sum(<ValueField2>), Sum(<ValueField3>) from from <TableName or View Name> where Month(<DateField1>) = “ & month(textBoxValue1) & “ and  Year(<YearField1>) = “ & Year(textBoxValue1) & “ group by <StringField1>, Month(<DateField1>), Year(<YearField1>)”
Jul 17 '07 #6

Post your reply

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