Alpha Video Training
Results 1 to 6 of 6

Thread: REPORT VARIABLE DATE

  1. #1
    Arthur Armour
    Guest

    Default REPORT VARIABLE DATE

    I have a form with several buttons to run reports. The form also has two variables, Start and Finish dates which are used in the reports as a filter. How can I get the variable for starting date to default to todays date when the form is opened to save the user typing this in. Many thanks in anticipation.

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default RE: REPORT VARIABLE DATE

    Edit the form, write code for the oninit event of the form, yourvariablename.value = date().

  3. #3
    Thomas Henkel
    Guest

    Default RE: REPORT VARIABLE DATE

    do you use a ui_get_date to retrieve the dates? if so, then you can set the date to default to today like this:

    resp = ui_get_date("Enter Date",dtoc(date()))

    This should work fine.

    the dtoc(date()) takes today's date and converts it to a string mm/dd/yyyy

    Tom

  4. #4
    Arthur Armour
    Guest

    Default RE: REPORT VARIABLE DATE

    Thanks guys. I should have mentioned that I'm not very clever with basic. However I did as Stan suggested and just put start_Date = date()in the oninit section of the report and it appears to work fine. Many thanks again.

  5. #5
    Member
    Real Name
    Robert Emery
    Join Date
    Aug 2001
    Posts
    145

    Default RE: REPORT VARIABLE DATE

    I use the following as a report filter expression:
    between(date_ship,Var->Askd_Start_date,Var->Askd_End_date)

    You don't have to define the variables (unless you want to print them) or use xbasic. Just replace one of the Ask variables with date().

  6. #6
    Terry Morgan
    Guest

    Default RE: REPORT VARIABLE DATE

    Try having a look at my post "Setting Dates" in the code archive - I suspect this or a slight version of it will be what you are looking for.
    Terry

Similar Threads

  1. Date variable in Web dialog
    By Steve Bovino in forum Web Application Server v6
    Replies: 1
    Last Post: 03-31-2005, 05:34 PM
  2. date variable
    By Alan Lee in forum Alpha Five Version 5
    Replies: 1
    Last Post: 02-26-2004, 07:14 PM
  3. Date from Variable
    By Amateur in forum Upgrading to Alpha Five from Alpha Four
    Replies: 5
    Last Post: 01-11-2004, 07:21 AM
  4. variable to date
    By russ Boehle in forum Alpha Five Version 5
    Replies: 7
    Last Post: 02-12-2003, 07:44 AM
  5. Date Variable Search
    By Ken Fleming in forum Alpha Five Version 4
    Replies: 8
    Last Post: 12-07-2002, 08:04 PM

Bookmarks

Posting Permissions

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