Results 1 to 5 of 5

Thread: VB Data Reports

  1. #1

    Thread Starter
    Frenzied Member mxnmx's Avatar
    Join Date
    Dec 2001
    Location
    I'm back...now!!!
    Posts
    1,396

    VB Data Reports

    I'm using VB datd Reports to create Reports & have given the user an option to choose from the following three:

    1) Daily Reports
    When the user chooses this option, I save it to the registry and when the program is being closed it looks for the option that is selected and if this is the chosen one...then the report is generated.

    2) Weekly Reports in this My sql query will change to something like this: "Select * from Table1 where Date > today < 7days...how do I write this query? And lets say user chooses weekly reports today...and till today he was having Daily reports...how do I count number of days...pls suggest ways...

    In other words I'm asking, if a user switches to Weekly reports, do I start counting days from today...or shall I start counting from every Monday....and please help me doing this. I have no clue how to count days...
    Can't Remember Birthdays or Important Dates- Never Miss any Important Date(s)

  2. #2

    Thread Starter
    Frenzied Member mxnmx's Avatar
    Join Date
    Dec 2001
    Location
    I'm back...now!!!
    Posts
    1,396
    I was just thinking about it, and if for example lets say...a user chooses daily reports at first...this option is no problem at all. But lets say that user changes from daily reports to weekly reports, what I would like is, that from the day he changes to Weekly...to the coming Saturday...a report is generated...and then from Monday-Saturday...a weekly report....is generated....Please help me...how to get this moving?
    Can't Remember Birthdays or Important Dates- Never Miss any Important Date(s)

  3. #3

    Thread Starter
    Frenzied Member mxnmx's Avatar
    Join Date
    Dec 2001
    Location
    I'm back...now!!!
    Posts
    1,396
    Could someone help me in writing a Query that will get data between two dates...Like getting all the transactions between Date1 & Date2...
    Can't Remember Birthdays or Important Dates- Never Miss any Important Date(s)

  4. #4
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    Your SQL would look something like this:

    Code:
    SELECT * FROM TABLE1 WHERE MYDATEFIELD BETWEEN '12/01/2002' AND '12/07/2002'

  5. #5
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542
    For a datareport use this:
    Private Sub Command1_Click()

    If DataEnvironment1.rsITDS.State = adStateOpen Then DataEnvironment1.rsITDS.Close

    DataEnvironment1.Commands("ITDS").CommandType = adCmdText
    DataEnvironment1.Commands("ITDS").CommandText = "SELECT * FROM ITDS WHERE [DATE] BETWEEN #" & Text1.Text & "# AND #" & Text2.Text & "# order by date "

    DataEnvironment1.ITDS

    DataReport2.DataMember = "ITDS"

    DataReport2.PrintReport
    'allows a refresh with new data without having to close the report first.
    DataReport2.Refresh
    Exit Sub


    just set the two different dates in the textbox.
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width