Nov 4, 2004 #1 herd Technical User Jun 23, 2003 46 US If I have two date fields (Date1 and Date2) how would I get a date3 that's between date1 and date2? Thanks Gary
If I have two date fields (Date1 and Date2) how would I get a date3 that's between date1 and date2? Thanks Gary
Nov 4, 2004 1 #2 KenReay Programmer Aug 15, 2002 5,424 GB There may be other ways but DateAdd("d",(DateDiff("d",Date1,Date2)/2),Date1) is one way Regards Ken Reay Freelance Solutions Developer Boldon Information Systems Ltd Website needs upgrading, but for now - http://www.kenneth.reay.btinternet.co.ukUK Upvote 0 Downvote
There may be other ways but DateAdd("d",(DateDiff("d",Date1,Date2)/2),Date1) is one way Regards Ken Reay Freelance Solutions Developer Boldon Information Systems Ltd Website needs upgrading, but for now - http://www.kenneth.reay.btinternet.co.ukUK
Nov 4, 2004 1 #3 PHV MIS Nov 8, 2002 53,708 FR Or simply this: Date3 = Date1 + (Date2 - Date1) / 2 Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244 Upvote 0 Downvote
Or simply this: Date3 = Date1 + (Date2 - Date1) / 2 Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
Nov 5, 2004 Thread starter #4 herd Technical User Jun 23, 2003 46 US When I put both of these codes into my date3 field I get a return of #Name?............what am I doing wrong Upvote 0 Downvote
When I put both of these codes into my date3 field I get a return of #Name?............what am I doing wrong
Nov 7, 2004 #5 KenReay Programmer Aug 15, 2002 5,424 GB Is the control called Date3?, if yes change its name to (say) txtDate3 Regards Ken Reay Freelance Solutions Developer Boldon Information Systems Ltd Website needs upgrading, but for now - http://www.kenneth.reay.btinternet.co.ukUK Upvote 0 Downvote
Is the control called Date3?, if yes change its name to (say) txtDate3 Regards Ken Reay Freelance Solutions Developer Boldon Information Systems Ltd Website needs upgrading, but for now - http://www.kenneth.reay.btinternet.co.ukUK