OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Addind days to returned values....

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> Addind days to returned values....
Page: [1]
 
siask

 

Posts: 8
Joined: 4/21/2009
Status: offline

 
Addind days to returned values.... - 9/21/2009 11:51:22   
I'm working on a little Database for our Intranet... An inoculation db....
Employees details are added with the date of an initial inoculation.... some will need reminders for, lets say 6 month boosters...

Is there a way to return a result from the db and have the .asp page automatically add 180days to the result?...

I have an initial value of <%=FP_FieldHTML(fp_rs,"Hep_a")%>

is it as simple as adding +180 in there somewhere?

I'm doing this via FP drw with a tweek in the coding where necessary

ta in advance
Si
TexasWebDevelopers

 

Posts: 722
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Addind days to returned values.... - 9/21/2009 13:33:28   
If you have a date/time field (call it "inoc_date") and it contains the date of the innoculation. Then you can easily add or subtract days/weeks/months to or from that date just as easily as you suggest:
<%
DIM inoc_date, booster_date
inoc_date=FP_FieldHTML(fp_rs,"Hep_a")
booster_date=inoc_date+180
%>
Your Booster Date is <%=booster_date%>.

_____________________________

:)

Follow us on TWITTER

(in reply to siask)
siask

 

Posts: 8
Joined: 4/21/2009
Status: offline

 
RE: Addind days to returned values.... - 9/22/2009 7:04:35   
Big thanks TWD....

I'm certainly doing something wrong.... it doesnt like the +180
Working perfectly without... not a chance with.... returning the following....

Type mismatch: '[string: "01/01/2000"]'

The field is Date/Time..... the date 01/01/2000 is the test date i'm using to set up the site....
any clues?....


(in reply to TexasWebDevelopers)
Spooky

 

Posts: 26681
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Addind days to returned values.... - 9/22/2009 16:04:51   
Search the dateadd function in this forum :

booster_date = DateAdd("d",180,inoc_date)

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to siask)
siask

 

Posts: 8
Joined: 4/21/2009
Status: offline

 
RE: Addind days to returned values.... - 9/23/2009 11:08:50   
Top Marks to Spooky and TWD... thanks lads

(in reply to Spooky)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> Addind days to returned values....
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts