I have an asp form which is capable of entering a Now() datetime stamp. Can anyone show me how I can then use this information to let change some text once 48 hours has passed? I.E. compare the now() time stamp with time now. As yet I've tried to use Date() but this does not count to exactly 48 hours after the initial time stamp.
I am trying to compare the NOW time with a "deadline" time. Please help. Just not sure why this is not working. I need to be able to say IF IT'S BEFORE 9:30 TODAY, IT'S OKAY TO ADD SOMETHING. IF IT'S AFTER 9:30 TODAY, YOU MUST ADD IT TOMORROW.
CODE:
nowtime=now() deadlinetime=formatdatetime(now(),2) + " 8:30:00 AM" response.write "NOW: " & nowtime & "<BR>" response.write "Deadline: " & deadlinetime & "<BR>" if nowtime<deadlinetime then response.write "can send out today" end if if nowtime>deadlinetime then response.write "must send out tomorrow" end if
RESULTS: NOW: 1/18/2007 8:51:43 AM Deadline: 1/18/2007 8:30:00 AM can send out today
As you can see, NOW is GREATER THAN Deadline, so it should must send out tomorrow.
If record is getting submitted between morning 6 am to night 12 pm the value of sdate should be current date or if the time is between night 12 to morning 6 the value of sdate should be the previous date but this comparison is not working please help me.
if (time()>"06:00:00 AM") and (time()<"07:00:00 AM") then sdate = Year(Date()) & "-" & Month(Date()) & "-" & Day(Date()) Response.Write(sdate) End IF
I need to check whether the curtime is greater then or equal to 12:00 am or less then or equal to 12:30am.i tried to use timeSerial to check the time but it comes out an error. Wrong number of arguments or invalid property assignment: 'TimeSerial' Code:
if (weekday(curdate) = 1) then if (TimeSerial(curtime) >= "12:00:00 AM" and TimeSerial(curtime) <= "12:30:00 AM") then curdate = date - 1 response.Write "cur_date = " &curdate& "<br>" end if end if
i want to keep the lower number between my two numbers (nbelem(querystring) is user defined and nbElemTbl is number of elements in the table) in my test nbElemTbl return 6 and nbElem(querystring) return 10 but it will always enter the if statement and my resulting number is alway 10.
SQLQry = "SELECT COUNT(echBassinNo) as nbElemTbl FROM tblEchantillon HAVING echBassinNo = '" & Bassin & "';" set rs = con1.Execute(SQLQry) dim nbElem if cint(Request.QueryString("nbElem")) > cint(rs.fields("nbElemTbl")) then nbElem = rs.fields("nbElemTbl") else nbElem = Request.QueryString("nbElem") end if
I would like to display the difference between the logging time [Session("start"] and the current time [now]. In hours minutes and seconds, I have tried a couple of things but all I see is gobbledy gook.
I have a website that I subscribe to that allows me to track tasks. I have an extra computer with a big monitor that i want to always display the task list. the problem is after so many hours I get logged out.
I need to need to reload that sign in url every few hours Code:
there i was just windering how do i compare a date/time vlaue in sql server agaisnt the computers' date/time. for example, if computer date/time is two months or 2 weeks before the database date/time do something
I store e-mail addresses in a database that are to be used for notification purposes. When the clients add e-mail addresses I want to check and make sure they have not entered an e-mail addresss in twice. Here is what I've got:
I have two arrays that hold the email addresses from the database and the email addresses from the form. I want to loop through the form's array and check it against the database array. If it finds a match then add it to an error message. If it does not find a match add it to the database. Sounds simple.
Here is the function that does the comparison: Code:
I have created a class registration application with DWMX. The first page shows a listing of all classes (names, date, instructor, etc) dynamically from the database. I would like for the page to only show current and future classes, and need some type of date compare code. Any ideas? Also how does this site make the pop window initiate when a user mouseovers a thread? I know how to do standard popups but haven;t yet figured out dynamic ones.
I need compare the recordset from a database and check if the file exists in a directory. If exists, I show a picture, case not, I dont show....
Sample: The result from a recordset was "hawai.jpg" Then I need to check if the file exists in a directory located in /images/countries/... IF exists I show the image IF NOT I show the message "Sorry, this country doesnt have a picture in the directory."
I have an application that creates online quizzes, each quiz has a results table generated by ASP on MS SQL Sever.
What I want to do is compare the SQL structure / code of the table I am about to create with the SQL structure / code of an existing table (previously created in ASP) to see if they are the same.
So how can I get the SQL structure of a table that already exists in my database into an ASP page?
I am trying to check if the variable size already exists in my shoppingCart array. However even though it does exist, the code below still returns false instead of setting itemp to true.
' 'Check if an item is already in the customers shopping cart ' Dim iLoop, itemp itemp = false For iLoop = 0 to UBound(Cart, 2) If (Cart(6,iLoop)=thesize) then itemp = true end if next
I have this login that i created. On the sign in process i need to make sure that no one has already signed up using that certain email or that unique cnumber.
Ive tried this line: Set objRS = verify.execute("SELECT id FROM logmein WHERE email='" & email & "'") or ("', cnumber= '" & cnumber & "';")
than this: Set objRS = verify.execute("SELECT id FROM logmein WHERE email='" & email & "'", "' & or & '", "' cnumber= '" & cnumber & "';")
Can I have one recordset execute a Select and then have another recordset execute a different Select, and then check if a field from the first recordset is different from the field in the 2nd recordset and if so write out that row on my displaying table?
I have 2 recordsets. One contains all customer info data, the other recordset contains 1 field of customer id's.
How do I create a recordset that contains all customer information (from the 1st recordset)for only the customers in the customer id recordset (2nd recordset)?
I am doing a project for Insurance Company. Here I have a field where the administrator enters the date he wants to close a particular verification process. I want to compare the closed date with the server date and if the date matches Update the database column as "DeActivated" or else the database column must show "Active".
using this i try to compare date in the ms acess DTm field and Tdate textbox date but when i type the same date in the text box as in the database in the DTm field i don't get any output of the matched dates details ...
I'm trying to see if a certain string matches a predefined string so I've tried:
-------------- If txtCondition3 = "NO THEFT COVER unless client claim free and occupied prems for 3 yrs" Then response.write "1st condition" Else response.write "2nd condition" End If --------------
I have two fields [InstallationDate & InstallComplete] created by using Date() to input a DateTime type in my database. InstallationDate is the first date which then gets compared with InstallComplete.
What I would really like is to calculate when InstallComplete is greater than InstallationDate by two days [or even better still 48 hours]. Once this has happened then a text warning must show. I was thinking along the following lines. I know it is wrong but you can hopefully see how I'm thinking.....
<td align="center"> <% if Trim(rsDisplayAll.Fields.Item("InstallComplete").Value) > 2 then Response.Write("you are delayed by two days") else %>
I have two date variable, namely, effective_date and expiry_date. I want to compare the two date variable to ensure the expiry date is always later than the effective date. I need to write this in javascript.
I get all the employees and the hiredates. But I want to restrict the display of only those employees where the hiredates is greater than or equal to the the 1st of the current month. Should I do this in SQL query or in VBScript? Which should be more effective?
I'm a novice to ASP programming. I have an Microsoft Access DB that has a date field (e.g. 8/9/2005) for each record. I want to write an SQL statement that only returns records for the past 7 days. I am accustom to written statements for DB2 access, such as:
select * from mytable where date(mydate) > date(current timestamp - 7 days)
I am trying to compare two strings and get the differenc in vbscript. Example:
Str1="This is a test text" Str2="This is a fine test text but a little long" I like to compare str1 with str2 and get the difference. Above example the difference will be "fine" and "but a little long" How do I do that?
i m trying to compare to dates which are in a db. the start date in the db is written MM/DD/YYYY and the middle date is writen DD/MM/YYYY. i m trying to figure out how many days months nd years thier are between them.
Currently working on a ASP for a friend, which requires the date and time on it. It pulls in entries from an Access Database with dates and times in the format of:
"Fri Oct 17 18:02:46 2003" However my date and time on the ASP page is displayed as: "Friday, October 17, 2003 18:02:46" using the script: "<%Session.LCID = 1033%> <%=FormatDateTime(Date(), vbLongDate)%> <%Session.LCID = 2057%> <%=time()%>"
Anyone know how to change this script, fully or partly to produce the date and time on the format that's in the access database i.e. "Fri Oct 17 18:02:46 2003" Code:
I am working on a database that collects information about incidents. One of the fields that people enter is the time of the incident. I am trying to convert that string that people enter into a OdbcType.Time and I am at a lost.
When the Form is submitted I use the Date() and Time() functions to put the date and time into the Body part of the e-mail. The time reported is three hours earlier than the time at which the Form is actually submitted.
I understand these functions are evaluated on the server so the server must be in a time zone three hours earlier than where I am . Is there any way I can get the local time at the location where the user is actually located. ?