Subject | Re: [firebird-support] Date functions |
---|---|
Author | Jason Dodson |
Post date | 2005-10-13T17:51:38Z |
You can use arithmatic on a Timestamp field. For instance, if I wanted to add a
day to a date field, you would do:
Select (MyDate + 1) as MyDatePlusOneDay
From MyTable;
Similarly, you can add a second by:
Select (MyDate + (1/86400)) as MyDatePlusOneSecond
From MyTable;
Jason
reinaldo_mra wrote:
day to a date field, you would do:
Select (MyDate + 1) as MyDatePlusOneDay
From MyTable;
Similarly, you can add a second by:
Select (MyDate + (1/86400)) as MyDatePlusOneSecond
From MyTable;
Jason
reinaldo_mra wrote:
> I did not find any function to add a value to a timestamp column. I need
> something like that:
>
> SELECT * FROM Table WHERE TimeStampColumn<=AddMonth( NOW, 5)
> SELECT * FROM Table WHERE TimeStampColumn<=AddDay( NOW, 5)
> SELECT * FROM Table WHERE TimeStampColumn<=AddHour( NOW, 5)
>
> The number 5 can be 5 days, 5 hours or 5 months. It depends on context.
>
> Thanks,
>