i have a date format d/m/yyyy h:m:s which users pick from a date picker into a text field in a form. But i want to format the contents into this form - d/m/yyyy.
Pls is there a function i can use to achieve this . I tried format(date_field) but it didn't work.
i have a few records sets that i am getting info from a db. I unsdersnd the sql side and off the top that is not what i am looking for do to db reasons i dont want to get into on this question. So please keep with asp for me. I need to conver the following from varchar to formatcurrency:
now i am able to do FormatCurrency on the sInd_PMT However when I us it on my sCK_Total I get the following error: Microsoft VBScript runtime (0x800A000D) Type mismatch: 'FormatCurrency'
Both fieds in the db are the same everything about these two variable are the same one is just the total amount for the check and the other is the individual amoutns that will later equal the check amount.
I am creating a new site where users can create their own profile. When my page is showing a specific profil the URL would be something like:
mysite.com?profile=543
The integer is of course the unique userid in my database. Now what I want is to be able to let user link to his profile on this form:
mysite.com/username
So the question is: can I/how can I, when the user enters mysite.com/username automaticaly redirect him to the corresponding site: mysite.com?profile=543
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 pulling info from a sql server By default the query pulls back the inforamtion as text.Therefore when I go to calculate some figures its giving me a type mismatch error. Is there a function in can call to convert a text string to an integer string using
rstSearch.Fields("name").Value .To pull back the info in a for loop
Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch
When I'm converting a date like 23-12-2004, everything goes okay, but a date like 5-3-2004 gives some troubles. It converts it in a way that 3 is the day and 5 is the month, but 5 has to be the day en 3 the month. how I can change settings, or has anyone a function which will convert a date in a way I'd like it?
I have the following code which I try to load an xml file, but in browser, I only get text value for each node, not whole xml string. I expect to see something like:
<name firstName="betty" lastName="Smith">I am at home</name> But I only see text "I am at home" did I do something wrong? Set xmlDom=CreateObject("Microsoft.XMLDOM")
I try to update a text field into Access database. When I click Update button script updates only first word of the phrase excluding other words. How can I fix it. Code:
<title>Partly Cloudy and 73 degrees F at Pitt-Greenville Airport, NC</title>
In an ASP file, how would I get the three characters before the word "degrees"? In this particular case, it would be "73 ". Obviously, I'm trying to extract the degrees from this weather string (which is from the National Weather Service, in case anyone is wondering). If anybody knows a better way to get the degrees information from this string.
EDIT: Nevermind. I found that the National Weather Service also offers an XML version that has the degrees totally separated. (The one above is from an RSS feed rather than straight XML.) Having it in this form makes it much easier to parse.
I've got an ASP script connected to a db table with a datetime field which is filled mannually for each record. When I want to select only those records with a date greater than todays date using this sql query:
Select * from fixtures where home_team_code = '" & idno & "' or away_team_code = '" & idno & "' and game_date > '" & today & "' order by game_date asc
it returns all records rather than only records with a date in the future. Is this something to do with the fact that i'm comparing a string to a datetime?? Can I use a VBScript function to make the string comparable to datetime?
I want insert string date from web form into oracle DB, using following to get date value:
sUpdateTime = Request.Form("date")
the date format the user enetr on the web is mm/dd/yyyy: h24:mi:ss (e.g. 04/13/2005 13:35:01). UpdateTime datatype in Oracle is date, so when insert sUpdateTime into DB, using following code got problem, I knew using To_Date (...) in the insert sql, but don't know the syntax.
I have a dynamically generated and FTP'd page that is sent to the server with a title of a song. Then when the user opens the page/site he or she will see the text in a marquee. What I want to do is create a IF Then Statement where it would look like the following:
I am getting a result like this: 'toh23'
and I want it to do either not show it or display and alternative text so...
<% if (TEXTSTRING) = "toh" then response.write("News") else response.write("Normal Text") end if %>
I have the if then else down but I have no clue how to split the text between the 'toh' and the '23'. It will always be toh and then a number but the number changes. I know you can split strings with commas and such but how about numbers?
I have some problem in my ASP project. I'm trying to pass the multi line text value from my Client side to server side. (The string having "Return Key" value). My ASP file doesn't response it.
I am trying to compare a variable with a db plain text field as follows: access db has field named HFRNUM as text .... ex: 12182003-A
I create a variable in vb as follows: Dim hfr_today HFR_Today = (Month(DATE)) & (DAY(DATE)) & (YEAR(DATE)) & "-A"
Unfortuantely, I think the HFR_Today var is not text and when I look for a record that is LIKE or = the var, it returns blank.
I display my variable and see 12182003-A, yet it does not find the record that matches (except data type perhaps?) Is my variable of a different data type, and if so, how can I make it plain text?
I am developing an application ASP and desire to validate the fields of dates before jumping to consultation SQL, the dates is entered text boxes and the idea is that been worth when losing the Focus. How I can do that?
I have built dynamic HTMLTable. Now I want to attach it directly to the Email Body - it is already built, so why not to use a ready table. However, I cannot find the way of getting plain HTML text out of dynamically built control. I tried to put my table between div and read div.innerHTML then - HTTP exception has been thrown.
I am having a newbie problem trying to Response.Write a static text string, 'Read More' into the output part of a hyperlink. I have tried my way of doing it but it doesn't work.
My code is below (the text string which I want to Response.Write is highlighted in bold):-
Response.Write ("<a href=""dummies_news.asp?ID=" & rsCTD("ID") & """> Read More & ">") Thanks for the help in advance - should be quite simple to solve, I'm sure!
I'm not a asp expert and only use the built in Dreamweaver stuff, the problem I'm getting is a datatype mismatch due to the fact the sql statement is expecting a text string and not a number string, can anyone have a look at the following code and point me in the right direction in regards of what I need to change so the sql statemnet know to expect a number string: Code:
i need to put a date of the following format: 14 June 2003 into a text box. i have seen some samples but i can't get what i want. i tried the following: <%=FormatDateTime(todaysDate,0) %> and it only rendered 00:00:00 .
Is this possible to check if a text box on form.htm is in mm/dd/yyyy format before submitting to asp page?
if you enter say 2/2/04 it gives a incorrect date format error. The asp page uses this text box in the select statement for a db2 table query that is a date field.
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: