I have never used extract. This generates a syntax error when I added
>and select extract( DOY FROM date)
>
> $sth = $dbh->prepare("SELECT date,address,time,host,direction,description,
> cal,reminder from firesides and select extract( DOY FROM date)
> where date > '$dstr1' and date <= '$dstr2'");
> if ($sth->execute)
> {
># assign each query record to an array
> $numrow = 0;
> while
> (($date,$address,$time,$host,$directions,$description,$cal,$reminder,
>$db_doy) = $sth->fetc\
>hrow)
>
>
>
As per me the error is quite evident because it must be some thing
like this
select extract(DOY FROM date'COLUMN_FIELD')
CREATE TABLE test_date (
"id" BIGSERIAL,
"exp_date" DATE,
"comp_int" int,
PRIMARY KEY("id")
)
add some data
and do as
prompt=# select comp_int as Compared_Integer , extract( DOY from
exp_date) as Compared_Date from test_date where id = 1 ;
compared_integer | compared_date
------------------+---------------
1 | 335
(1 row)
this may gve you results .
Regards,
V kashyap