Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Dates
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

DarkDrift
Junior Member

USA
126 Posts

Posted - 04 February 2005 :  18:08:27  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
I am trying to make a "Billing" system and I have found code that will take how many days different a date is like this:


Dim dtNow, dtY2K
dtNow = Date()
dtY2K = DateSerial(2005, 1, 2)
dtY3K = DateSerial(2005, 1, 1)

Dim iDaysDifference
iDaysDifference = DateDiff("d", dtY2K, dtNow)
Response.Write(iDaysDifference)
Response.Write(dtY3K)
If IDaysDifference > 30 then
	Response.Write("BILL!")
else
	Response.Write("BILLED!")
end if

How do I submit a date to my Access Database in the Form of year, month, day?
Then from there I would do:


    strsql = "SELECT * FROM BILLING WHERE M_ID = '" & MemberID & "'"
    set rsC = Server.CreateObject("ADODB.RECORDSET")
    rsC.open strsql, my_conn
    'MY ORDER BY STUFF HERE
    'MY LAST RECORD (most up to date)
    strUserPaymentDate = rsC("PAYMENT_DATE")
    set rsC = nothing
Dim dtNow, dtY2K
dtNow = Date()
dtY2K = DateSerial(strUserPaymentDate)
dtY3K = DateSerial(2005, 1, 1)

Dim iDaysDifference
iDaysDifference = DateDiff("d", dtY2K, dtNow)
Response.Write(iDaysDifference)
Response.Write(dtY3K)
If IDaysDifference > 30 then
	Response.Write("BILL!")
else
	Response.Write("BILLED!")
end if


Now how to just get that date into the DB. Should I use like a replace function for the / to replace it with , ?
If so How?
Thanks for all help that can be Given

http://www.xcalliber.com - The Future of Boards

DarkDrift
Junior Member

USA
126 Posts

Posted - 04 February 2005 :  20:14:48  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
NVM I tried something like this


year(s) from dates <br>
date_variable = #7/4/1776# <br>
<% date_variable = #7/4/1776# %>
datediff("yyyy",date_variable,date()) = 
<%=datediff("yyyy",date_variable,date()) %>


Thanks Everyone

http://www.xcalliber.com - The Future of Boards
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.18 seconds. Powered By: Snitz Forums 2000 Version 3.4.07