1,105,271 Community Members

daily,monthly and annual reports

Member Avatar
maichy
Newbie Poster
17 posts since Sep 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
-1
 

hi all am trying to obtain a daily report from my database using the code below but it keeps giving me an error of false,when i say debug.print. when i say rptETR.show it gives me all the transactions and not the daily transactions.below is the code

Private Sub Cmddaily_Click()
Dim pubsql As String
    Getdata "Table1"
    pubsql = "SELECT * FROM table1 WHERE transaction_date " = "09/23/2010"
    Debug.Print pubsql

End Sub

can anyone please help me.
if u have an idea how i would go about showing the monthly and annual report please share it with me.
thanks in advance

Member Avatar
AndreRet
Industrious Poster
4,492 posts since Jan 2008
Reputation Points: 362 [?]
Q&As Helped to Solve: 499 [?]
Skill Endorsements: 24 [?]
 
0
 

Try the following by changing your sql statement -

'pubsql = "SELECT * FROM table1 WHERE transaction_date " = "09/23/2010" to

pubsql = "SELECT * FROM table1 WHERE transaction_date = DateValue('09/23/2010')
Member Avatar
maichy
Newbie Poster
17 posts since Sep 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

thanks Andre,
this seems to work since the error false is no longer there bt i still cannot see the report.when i replace the debug.print with rptetr.show it still displays the whole report,any suggestions on what might be wrong?
thanks

Member Avatar
AndreRet
Industrious Poster
4,492 posts since Jan 2008
Reputation Points: 362 [?]
Q&As Helped to Solve: 499 [?]
Skill Endorsements: 24 [?]
 
0
 

Try and set the report datasource after the new sql statement.

Member Avatar
maichy
Newbie Poster
17 posts since Sep 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

hi andre i tried this but am still getting the whole report

Member Avatar
jhai_salvador
Posting Whiz in Training
237 posts since Mar 2008
Reputation Points: 48 [?]
Q&As Helped to Solve: 40 [?]
Skill Endorsements: 2 [?]
Sponsor
 
0
 

What report are you using? Is it DataReport? Crystal Report? Active Report?..

Member Avatar
AndreRet
Industrious Poster
4,492 posts since Jan 2008
Reputation Points: 362 [?]
Q&As Helped to Solve: 499 [?]
Skill Endorsements: 24 [?]
 
0
 

Have you set it as in?

Set DataReport.DataSource = MyRs.Recordset

Datareport.Show
Member Avatar
AndreRet
Industrious Poster
4,492 posts since Jan 2008
Reputation Points: 362 [?]
Q&As Helped to Solve: 499 [?]
Skill Endorsements: 24 [?]
 
0
 

I have also found the following sites which I'm sure will answer your question on how to load only the selected data -

http://support.microsoft.com/default.aspx?scid=KB;en-us;190411

or

http://www.tek-tips.com/viewthread.cfm?qid=148876

or

http://www.tek-tips.com/viewthread.cfm?qid=88923

Member Avatar
maichy
Newbie Poster
17 posts since Sep 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

thanks guys for ur help the sites were a great help i can now view my report as i wanted.

Question Answered as of 3 Years Ago by AndreRet and jhai_salvador
Member Avatar
AndreRet
Industrious Poster
4,492 posts since Jan 2008
Reputation Points: 362 [?]
Q&As Helped to Solve: 499 [?]
Skill Endorsements: 24 [?]
 
0
 

Only a pleasure. Happy coding.

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article