IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#53790 - 08/04/16 06:25 PM Adding Dates
DanG Offline
OL Newbie

Registered: 07/07/15
Posts: 14
I have a variable date field that I need to add 50 days to it. Does anyone know how to do this?

Thanks
Dan


Edited by DanG (08/05/16 01:20 PM)

Top
#53798 - 08/08/16 07:25 AM Re: Adding Dates [Re: DanG]
Sander vd Berg Offline
OL Expert

Registered: 06/10/08
Posts: 207
Loc: Objectif Lune NL
I don't know if this will work for you since it depends on the format of the values in your database, but you could try this advanced trick.

Let's assume your date field is called MY_DATE. Go to Database > Select Table, and double-click Custom. The custom query will initially look like "SELECT * FROM ...". Don't change whatever comes after FROM, but edit the SELECT part so that it reads:

Code:
SELECT *, DateAdd("d", 50, MY_DATE) AS DATE_PLUS_50 FROM ...

This custom query allows you to access the original fields in your database plus a new field called DATE_PLUS_50. The value of this new field can be formatted in an expression using PSM's DATE function.

Top
#53799 - 08/08/16 09:14 AM Re: Adding Dates [Re: Sander vd Berg]
DanG Offline
OL Newbie

Registered: 07/07/15
Posts: 14
Thank you! I have used PSM for over 6 years and I had no idea about adding queries. smile

Top