HELP! Needed with Fox Pro date math

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default HELP! Needed with Fox Pro date math

    I am accessing a Fox Pro database through ODBC in ASP.

    I have a table with two dates in it. A start date and an end date. I
    need to create a table with the difference between the two dates.

    Is the only way to load each record into an array and calculate the
    difference myself, or can it be done in the SELECT statement?

    --Dave

    Dave Navarro Guest

  2. Similar Questions and Discussions

    1. Math opreation with DATE
      hi, anyone hav idea how can i do math operation with date in flash?
    2. Math::GMP tests and Crypt::Random fail on Compaq (Math::Pari related ??)
      Hi, I've been compiling Math::GMP for different OS's in order to use Net::SFTP and I have successfully compiled and used it for Solaris,...
    3. Math Help Needed
      I'm doing some php math and need to divide a floating point number variable by only 4 decimal places - when I do the following: $aspect_ratio =...
    4. Date Math
      In MySQL/PHP I convert a MySQL date from a query and just do not know the syntax to add say "1 month" to this date ... <?php echo...
    5. Help needed with basic Perl math commands
      Hey everyone, I'm writting a simple script that takes data from a text file and calculates percentages. Lets call this file "data.txt" In data.txt,...
  3. #2

    Default Re: HELP! Needed with Fox Pro date math

    Does FoxPro not have a DATEDIFF statement?

    INSERT INTO newTable(primary_key, Diff)
    SELECT primary_key, DATEDIFF(?, DateCol1, DateCol2)
    FROM oldTable

    I put ? in there for two reasons: (a) I don't know if FoxPro accepts string
    parameters or named constants, and (b) you didn't bother telling us what
    difference you want (hours, days, years, ...)



    "Dave Navarro" <dave@dave.dave> wrote in message
    news:MPG.199fce26bd82f77f989746@news-east.giganews.com...
    > I am accessing a Fox Pro database through ODBC in ASP.
    >
    > I have a table with two dates in it. A start date and an end date. I
    > need to create a table with the difference between the two dates.
    >
    > Is the only way to load each record into an array and calculate the
    > difference myself, or can it be done in the SELECT statement?
    >
    > --Dave
    >

    Aaron Bertrand [MVP] Guest

  4. #3

    Default Re: HELP! Needed with Fox Pro date math

    In article <uR9Ayu0XDHA.1384@TK2MSFTNGP10.phx.gbl>,
    [email]aaron@TRASHaspfaq.com[/email] says...
    > Does FoxPro not have a DATEDIFF statement?
    >
    > INSERT INTO newTable(primary_key, Diff)
    > SELECT primary_key, DATEDIFF(?, DateCol1, DateCol2)
    > FROM oldTable
    >
    > I put ? in there for two reasons: (a) I don't know if FoxPro accepts string
    > parameters or named constants, and (b) you didn't bother telling us what
    > difference you want (hours, days, years, ...)
    Apparently Fox Pro does not.

    I need the number of days between two dates. It's a real estate
    application and I need to display a table showing the number of days
    between when a house was listed on the market and when it sold, sorted
    by the number of days it took to sell.

    The only way I can think of is to loop through the entire database and
    build and array. Very slow, but it works.

    --Dave
    Dave Navarro Guest

  5. #4

    Default Re: HELP! Needed with Fox Pro date math

    Dave Navarro wrote:
    > In article <uR9Ayu0XDHA.1384@TK2MSFTNGP10.phx.gbl>,
    > [email]aaron@TRASHaspfaq.com[/email] says...
    >> Does FoxPro not have a DATEDIFF statement?
    >>
    >> INSERT INTO newTable(primary_key, Diff)
    >> SELECT primary_key, DATEDIFF(?, DateCol1, DateCol2)
    >> FROM oldTable
    >>
    >> I put ? in there for two reasons: (a) I don't know if FoxPro accepts
    >> string parameters or named constants, and (b) you didn't bother
    >> telling us what difference you want (hours, days, years, ...)
    >
    > Apparently Fox Pro does not.
    >
    > I need the number of days between two dates. It's a real estate
    > application and I need to display a table showing the number of days
    > between when a house was listed on the market and when it sold, sorted
    > by the number of days it took to sell.
    >
    > The only way I can think of is to loop through the entire database and
    > build and array. Very slow, but it works.
    >
    > --Dave
    1. Don't loop through your "database". If you're going to create an array,
    use GetRows.
    2. You will have a better chance of discovering the FOXPRO syntax by asking
    on a FOXPRO newsgroup. Just because you're using ASP doesn't mean you HAVE
    to ask your question on an ASP newsgroup. Your question has to do with a
    FOXPRO query, which is totally separate from ASP (remember, you could just
    as well be running the query within the FOXPRO environment). Here's a likely
    candidate:
    microsoft.public.fox.vfp.queries-sql

    HTH,
    Bob Barrows


    Bob Barrows Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139