working with dates
Posted: Thu Jun 05, 2014 11:12 am
Hi,
In my databse i have one date in this format: dd/mm/yyyy
and once i make a select to work with this date, i would like to add one variable nDays ( number of days that the user can choose)
And i wrote this:
convert tdate to seconds --tdate is what i have in my database ( in this case 12/06/2014...The format is dd/mm/yyyy )
put nDays * 60 * 60 *24 into daysSeconds
add daysSeconds to tdate
convert fechaFin to system date
answer "fecha " & tdate
And it is not working well...The date shown is not the expected one...
In this case i have that tdate is 01/02/2015...my nDays was 27 and the tdate from the database was 12/06/2014
But if i do this:
put the date into tdate
convert tdate to seconds --SO NOW THE DATE IS NOT COMING FROM MY DATABASE WITH THE FORMAT dd/mm/yyyy
put nDays * 60 * 60 *24 into daysSeconds
add daysSeconds to tdate
convert fechaFin to system date
answer "fecha " & tdate
In this case i have that tdate is 02/07/2014...Because my nDays was 27
it is working well...
Do you know why is acting like this? What am i doing wrong?
regards,
fko
In my databse i have one date in this format: dd/mm/yyyy
and once i make a select to work with this date, i would like to add one variable nDays ( number of days that the user can choose)
And i wrote this:
convert tdate to seconds --tdate is what i have in my database ( in this case 12/06/2014...The format is dd/mm/yyyy )
put nDays * 60 * 60 *24 into daysSeconds
add daysSeconds to tdate
convert fechaFin to system date
answer "fecha " & tdate
And it is not working well...The date shown is not the expected one...

In this case i have that tdate is 01/02/2015...my nDays was 27 and the tdate from the database was 12/06/2014
But if i do this:
put the date into tdate
convert tdate to seconds --SO NOW THE DATE IS NOT COMING FROM MY DATABASE WITH THE FORMAT dd/mm/yyyy
put nDays * 60 * 60 *24 into daysSeconds
add daysSeconds to tdate
convert fechaFin to system date
answer "fecha " & tdate
In this case i have that tdate is 02/07/2014...Because my nDays was 27
it is working well...
Do you know why is acting like this? What am i doing wrong?
regards,
fko