I am trying to compare two dates. My problem is no matter what the value of mydate, it is still fall in the first IF statement condition (even if mydate is 10/10/2004). Any advise for this matter?
mydate = "6/6/"&year(date) IF date() <= mydate THEN response.write "first half of the year" ELSE response.write "second half of the year" END IF
I am trying to compare a date in my database to the current date. MySQL statement is:
sqltemp5="select * from users where dateclosed <= '" & date & "'"
What I am trying to accomplish is exclude records where the dateclosed field is older than todays date. Such as if dateclosed = 6/30/2004 then today being 08/25/2004 that record should be excluded.
I need an ASP routine that will take a date, compare it to the present date, and then output the difference in Years, Months, and Days. (I'm too swamped to write it myself & I'm sure somebody already wrote it better than I can)If anyone can point me towards such a routine,
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 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 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 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.
Need some help with comparing a date field retrieved from an access date base to the current date. Basically I'm looking to create and if statement like:
I have an asp page that uses a calendar.js (pop-up) file to add an exact date format in the text field (txtDDate). My problem is I need some javascript that sets an alert that does not allow them to select today.
example: var dtToday = Date() if(document.frmSoftware.txtDDate.value == dtToday) { alert("You cannot select same day distributions. Please enter a new value in the "Delivery Date" field."); return false }
But dtToday seems to be blank....How can I get dtToday value? Also, when I set the dtToday value outside javascript and used a Response.Write to see what format Date() came up with - it gave me 1/24/2005 - but the calendar pop-up gives me 01/24/2005....could this also be the issue?
I have an Intranet-based app at work, and I have it in two places there: a dev machine and a production box. In both cases, the ASP files and SQL Server 2000 database are on the same box. I have it running smoothly in both places at work.
However, I've been trying to set it up at home, and cannot make the SQL Server connection work for some reason. I've been working on this off and on for weeks, and I just don't get what I am missing. Code:
i found out that by default, ASP apps can only access files that are on the computerthat the server runs on. how can i change this so the IIS will take the files off the client's computer?
I am trying to do a very simple piece of asp on a w2k3 server on the company intranet where i work (using IIS 6) the code is simply trying to get an xml stream via a ServerHTTPRequest.
The code I have works absolutely fine, I have tested it on a free asp friendly server on the net and it does exactly what i want it to! however when I run the code on the company intranet I get hit with the following problem.... Code:
I've create a custom com object and I use it as follow:
set test = Server.CreateObject(myObject.classID) ' --> all OK the istance of the object is correctly created
retval = test.function1(par1, par2 ...) ' --> as soon as I call every function of my com object the system returns the following error: 0x8000FFFF: catastrophic failure. I do not know why
I use the method below to send emails from an asp page that's part of a web application:
<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows 2000 Library" --> <% On error Resume Next Dim cdoConfig, cdoMessage
Set cdoConfig = Server.CreateObject("CDO.Configuration") With cdoConfig.Fields .Item(cdoSendUsingMethod) = 2 .Item(cdoSMTPServer) = "MailServer.Name.com" .Item(cdoSMTPServerPort) = 25 .Update End With Set cdoMessage = Server.CreateObject("CDO.Message") With cdoMessage Set .Configuration = cdoConfig .From = "Me<mailsender@mymail.com>" .To = "You<mailrecipient@somemail.com>" .Subject = "Surprise!" .TextBody = "Helloooo..." .Send
If err.number Then Response.Write("Houston! We have a problem...") End If End With Set cdoMessage = Nothing Set cdoConfig = Nothing %>
On the production server (Windows 2003 Server) everything works fine and I don't have a problem sending the mails from the application. However, I recently upgraded my development box to Windows XP Pro SP2 and the code fails with with the following error:
CDO.Message.1 (0x80040213) The transport failed to connect to the server.
The from and to email addresses that I'm using are valid and part of my domain (not a Hotmail or other freemail address).
The SMTP service is up and running on the dev box.
I also tried replacing the mail server name with the IP address of the mail server, but again it's failing.
We are running Exchange Server for email and if I change the cdoSendUsingMethod to 3 (for cdoSendUsingExchange) the mail is sent correctly without errors.
Will I not able to use the cdoSendUsingPort method to send the email if I'm on Exchange? Am I forced to use cdoSendUsingExchange?
Anyone got much of a clue how best to send emails to selected people from a database table and to be able to track them, maybe as much as a read receipt, or perhaps just checking that they don't bounce, or end up in the bad mail folder.
Is this best/possible to try and code or is there a free/cheap component that does this simply.
I am developing a simple booking system where I had a booking date. The problem is I want to make sure that the user must book 3 days in advanced for certain room.
I have tried to use DateDiff but it seems doesn't work. Actually i just 1 to make sure that the user must book 3 days in advanced from the current date. I am wondering whether there is anything goes wrong in my datediff function. Code:
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 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 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?
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 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 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