Paradox 3.5 days of the week script

Paradox 3.5 days of the week script

Post by kall » Wed, 09 Oct 1996 04:00:00



I've come across a need for a script that will take a date field and
return a day of the week from it (ie 10/08/96 will return Tuesday) is
there any such animal for 3.5 (if push comes to shove I can use a script
written for 4.5)? And if there is one where can I find it?

 
 
 

Paradox 3.5 days of the week script

Post by James Mile » Wed, 09 Oct 1996 04:00:00



> I've come across a need for a script that will take a date field and
> return a day of the week from it (ie 10/08/96 will return Tuesday) is
> there any such animal for 3.5 (if push comes to shove I can use a script
> written for 4.5)? And if there is one where can I find it?

 You do not need a script/routine to do this if you are considering V4.5
since the DOW() function does just this.

 
 
 

Paradox 3.5 days of the week script

Post by kall » Thu, 10 Oct 1996 04:00:00


This is what can happen when you set out to ask one question while think
about another. I meant to ask is there a function or a script that will
return a julian date such as for 10/09/96 the julian date would be 96283.
I need this for PdoxDos 3.5 (the good thing about my screwup here is now
I know DOW() is available in 3.5)

 
 
 

Paradox 3.5 days of the week script

Post by Robert Emmo » Sat, 12 Oct 1996 04:00:00



>This is what can happen when you set out to ask one question while think
>about another. I meant to ask is there a function or a script that will
>return a julian date such as for 10/09/96 the julian date would be 96283.
>I need this for PdoxDos 3.5 (the good thing about my screwup here is now
>I know DOW() is available in 3.5)

I wrote some routines in C, called the Julian Date Library. They could
be ported to Paradox. They were available by ftp from oak.oakland.edu
and from Compuserv:

08-21-93    oak.oakland.edu in /pub/msdos/c      as JULIAN10.ZIP
07-30-93    Compuserve      in BCPPDOS Library 5 as JULIAN.ZIP

JULIAN v1.05 includes full C source code, and provides a
library of date routines which are useful in financial and
other types of programs. The functions allow you to translate
dates between: Gregorian (a struct containg {month, day, year}
like {9, 12, 92}), string (like "9/22/93"), and Julian day
numbers (like 727453). Julian day numbers let you calculate
days between dates, day of week, etc. The README file has an
explaination of leap years, Julian and Gregorian dates.

----------------------------------------------------

       CalcShop Inc., (201)228-9139

 I just hope I can get through life without getting
                some fatal disease.

 
 
 

Paradox 3.5 days of the week script

Post by Julius C. Georgede » Sat, 12 Oct 1996 04:00:00



> I've come across a need for a script that will take a date field and
> return a day of the week from it (ie 10/08/96 will return Tuesday) is
> there any such animal for 3.5 (if push comes to shove I can use a script
> written for 4.5)? And if there is one where can I find it?

Have you tried using DOW()?

The syntax would be DOW(10/08/96) and would return "Tue"

 
 
 

Paradox 3.5 days of the week script

Post by Bill Parro » Sat, 12 Oct 1996 04:00:00



Quote:>This is what can happen when you set out to ask one question while think
>about another. I meant to ask is there a function or a script that will
>return a julian date such as for 10/09/96 the julian date would be 96283.
>I need this for PdoxDos 3.5 (the good thing about my screwup here is now
>I know DOW() is available in 3.5)

not off hand, but you might want to try the Paradox Informant web site
http://www.informant.com.

Bill

 
 
 

Paradox 3.5 days of the week script

Post by Julius C. Georgede » Sat, 12 Oct 1996 04:00:00



> This is what can happen when you set out to ask one question while think
> about another. I meant to ask is there a function or a script that will
> return a julian date such as for 10/09/96 the julian date would be 96283.
> I need this for PdoxDos 3.5 (the good thing about my screwup here is now
> I know DOW() is available in 3.5)

It's been about 4 years since I've used PdoxDos 3.5, or had to deal with
the Julian date problem; however, here is how I remember it:

        If I remember correctly there was no built in function for      extracting
the Julian date from a given date.

As a result I was forced to write a short script that went something
like the following:

        Year.a = STRVAL(Year(Today()))

        BegYr.d = DATEVAL("1/1/" + Year.a)

        JulNum.n = Today() - BegYr.d + 1

        JulDate.n = NUMVAL(Year.a + STRVAL(JulNum.n))

In my example I am determining the Julian date for the current day, but
any variable or field value can be plugged in.  All I am doing is
subtracting the first of the year from the date in question (I may be
mistaken, but I recall having to add 1 to to the result in order to get
the correct Julian day number). I then attach the year value.

I'm sure if I missed a step, or added a couple, I'll here about it.  But
this is the way I remember it.  Good luck.