Thread: Date question....

Date question....

From
"Kovalcik, Mike A [ITS]"
Date:

Hi,

I'm trying to remove a date from table and it won't work.  Basically I have an address book with birthdays and anniversaries and I want to remove an anniversary date from one of the entries.  Every time I try it gives me "Bad date external representation".  How do I remove a date from an entry? 

Please help……

Thanks,
Mike

Re: Date question....

From
Bruno Wolff III
Date:
On Tue, May 20, 2003 at 18:08:22 -0500,
  "Kovalcik, Mike A [ITS]" <mkoval01@sprintspectrum.com> wrote:
> Hi,
>
> I'm trying to remove a date from table and it won't work.  Basically I
> have an address book with birthdays and anniversaries and I want to
> remove an anniversary date from one of the entries.  Every time I try it
> gives me "Bad date external representation".  How do I remove a date
> from an entry?

The answer depends on how the date is represented. Why don't you show
us how the table is defined and the statement you tried, but that didn't
work.

Re: Date question....

From
Bruno Wolff III
Date:
On Thu, May 22, 2003 at 10:38:54 -0500,
  "Kovalcik, Mike A [ITS]" <mkoval01@sprintspectrum.com> wrote:
> Well....
>
> I set my table up like...
>
> Bday date
>
> Where bday is my column name and date is the data type....
>
> I've tried a lot of things to remove it, but I've had no luck:
>
> UPDATE address SET Bday = '' WHERE addressid = '4'
>
> This is when it gives me the error, but I'm not sure what else to put
> there to make sure it is in date format to remove the date completely...

If you are doing things this way then you probably want to use:
UPDATE address SET Bday = NULL WHERE addressid = '4'

Re: Date question....

From
Bruno Wolff III
Date:
On Thu, May 22, 2003 at 10:50:10 -0500,
  "Kovalcik, Mike A [ITS]" <mkoval01@sprintspectrum.com> wrote:
> Is there a better way to do this?

How are you using the data?

Having NULL represent unknown is a reasonable way to do this.

Even if you delete the date entries, when you join the table back
with your main id table, you are most likely want to use an outer
join which will result in the missing birthdates being represented
as nulls anyway.

Re: Date question....

From
"Kovalcik, Mike A [ITS]"
Date:
Is there a better way to do this?

-----Original Message-----
From: Bruno Wolff III [mailto:bruno@wolff.to]
Sent: Thursday, May 22, 2003 10:51 AM
To: Kovalcik, Mike A [ITS]
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Date question....


On Thu, May 22, 2003 at 10:38:54 -0500,
  "Kovalcik, Mike A [ITS]" <mkoval01@sprintspectrum.com> wrote:
> Well....
>
> I set my table up like...
>
> Bday date
>
> Where bday is my column name and date is the data type....
>
> I've tried a lot of things to remove it, but I've had no luck:
>
> UPDATE address SET Bday = '' WHERE addressid = '4'
>
> This is when it gives me the error, but I'm not sure what else to put
> there to make sure it is in date format to remove the date
> completely...

If you are doing things this way then you probably want to use: UPDATE
address SET Bday = NULL WHERE addressid = '4'

Re: Date question....

From
"Kovalcik, Mike A [ITS]"
Date:
Well....

I set my table up like...

Bday date

Where bday is my column name and date is the data type....

I've tried a lot of things to remove it, but I've had no luck:

UPDATE address SET Bday = '' WHERE addressid = '4'

This is when it gives me the error, but I'm not sure what else to put
there to make sure it is in date format to remove the date completely...

Thanks,
Mike

-----Original Message-----
From: Bruno Wolff III [mailto:bruno@wolff.to]
Sent: Thursday, May 22, 2003 7:13 AM
To: Kovalcik, Mike A [ITS]
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Date question....


On Tue, May 20, 2003 at 18:08:22 -0500,
  "Kovalcik, Mike A [ITS]" <mkoval01@sprintspectrum.com> wrote:
> Hi,
>
> I'm trying to remove a date from table and it won't work.  Basically I

> have an address book with birthdays and anniversaries and I want to
> remove an anniversary date from one of the entries.  Every time I try
> it gives me "Bad date external representation".  How do I remove a
> date from an entry?

The answer depends on how the date is represented. Why don't you show us
how the table is defined and the statement you tried, but that didn't
work.