Formating Year
I want to be able to format a year as mm/dd/yy
formatdatetime does not work because the year is yyyy. How do I format a 2 digit year such as 04 for 2004?
I want to be able to format a year as mm/dd/yy
formatdatetime does not work because the year is yyyy. How do I format a 2 digit year such as 04 for 2004?
I would like to format URLS that are being retreived from a database. Here is an example:
bodytext="this is some text http://www.sitepoint.com/ this is some more text"
response.write(bodytext)
how could I change the URL (http://www.sitepoint.com/) to a link? So instead of http://www.sitepoint.com/, it would be <a href="http://www.sitepoint.com/">http://www.sitepoint.com/</a>. There are going to be an infinate amount of URL's (the user can type in any one) and it is just not the URL by itself.
When i send a text string to my database linebreaks are stored, but when i call it from asp to the page all linebreaks are lost.
this will reformat text to look different than i was initially typed, how can i make the text shown on webpage in orginal formating.
hope im clear on this or ask and i will elaborate.
does anyone know if there is a function to format date?When my date is extracted from database, it is in decimal format (ie.38233.72078), is there a way to convert this number to date formate using asp?
View Replies View RelatedI have a list of dates in a sql database that are input as varchar like this 042999
How do I insert / in between the date/month and year
so this 042999 will appear like this 04/29/99
Having a pretty annoying format 'error'
The below code works fine,
strMessage = "Logged in as: " & Session("UserName") & ""
but it displays as:
Logged in as:
'Username'
Were as i want it to be:
Logged in as: 'Username'
Any ideas how to make it go to one line?
I posted before about replacing special characters (esp. '). However, I am wondering how formatting can be kept when entering it into a textbox to store in a database?
When text with seperate paragraphs is entered, it comes out as one big paragraph later on.Is there anyway to address this? When I was doing my searching - somethign about chr(10) kept coming up, but I am not sure what this is.
I have an ASP page taking data from a table. I would like that the data is shown as a % (like 51.456897%) All it shows with my code below is 0.51456897.
Can someone tell me how to change the code so that my % is shown? ....
I am importing a time into a sql datetime field from a text datafile using vbscript in an asp file. The time coming in will look like 8:00 or 3:30 or some other similar thing.
Because it is doesn't have am or pm associated with it, I have to force the issue or sql will assume am all of the time, and I am sure that no judge in our county is going to hear a case in the middle of the night!
So I have to add 12 hours to anthing that could be an afternoon time before I add it to the database to keep it from looking stupid in the display screens.
if we use formatnumber library function in asp it will format the no as per the number format defined in the locale of the server. For example:
some number format look like this 34,135,200 (comma seperated)
some looks like this 34 135 200(blank spaces seperated)
so does anybody have a vbscript function which do this job.
I have the following variable being displayed but i would like it displayed in the default font and text size 2 how is it done?
<% response.write(sUserId) %>
Is there a way to output a date in latin american format?
You know the day first, the month second and the year last.
I have a report that will format a number to the last 2 decimal places. However it will trim off the 0 at the end. Example.
98.90 is formated to 98.9
how can i tell the format number function to not trim the 0 but still have the last 2 digits.
I am storing dates in a mySql database in the format yyyy-mm-dd. Now, I have set up so that this field is insert by a form.
It isn't very user friendly to have to type yyyy-mm-dd, how can I set up so that the user can enter format dd/mm/yyyy and it will automatically insert into the database as yyyy-mm-dd? I am using Dreamweaver MX 2004 and ASP.
I have a querystring that passes through the value 001 for example, the form on the receiving page need to display that number but with 1 added to it. i have
dim strnum
strnum = request.querystring("value")
strnum = strnum + 1
when displayed <%=strnum%> shows 2 instead of 002, and the zero's are very important, is there any number formating trick i dont know or another way of doing this?i thought about coding the first two zero's in before i call the strnum but this would mess things up when i get to 010 etc.
I have an sqlstatement which is executing on my form it works fine in sql server enterprise manager but obviously the function that is used in sql server enterprise manager will not work on a form i am coding with asp...my sql statement is as follows
Sholiday.source = "Select * from Year WHERE Year= IsDate(Year) order by bhdate"
this doesnt work fine, because i would like that the Year that my sqlstatement picks up to be equal to the current year we are in..can anyone tell me what the function for that is in vbscript... i am using vbscript and asp..
Basically what im trying to do is create a dynamic drop down box that changes its output each year.
It is a drop down box that displays years, but i need it to be always a minimum of 18 years minimum from the current year e.g as its 2004, it needs to display 1986 as its minimum year and upwards to 40 years from 2004, because the type of people im looking for need to be over 18, and no more than 40... And this is within a form, so the users choice of years is collected on submit.
I have a set of values like name,age,desg,salary,year etc . currently i am getting the values using max(year) and displaying the values year is integer in my sqlserver db
If you go thru my code (see attachment) you would be able to understand.
Now the problem is if a person gets promoted or hike in his salary i have to display two differnt salary on the same year how do i do that. currently i am displaying the values based on the max(year) max(year)-1 etc. i cannot modify the database. i have to do some changes on my coding only. Please view my coding as attachment (3000.txt).
For example
Name Age Desig Salary Year
abc 35 CEO 39000 2004
abc 35 CFO 38000 2003
abc 35 CTO 37000 2002
abc 35 CTO 35000 2001
abc 35 Direcotr30000 2001
How do i display this from the database.
I have a set of values like name,age,desg,salary,year etc
currently i am getting the values using max(year) and displaying the values year is integer in my sqlserver db If you go thru my code (see attachment) you would be able to understand.
Now the problem is if a person gets promoted or hike in his salary i have to display two differnt salary on the same year how do i do that. currently i am displaying the values based on the max(year) max(year)-1 etc. i cannot modify the database. i have to do some changes on my coding only. Code:
I have a form and I request a date. I want the slashes(02/25/2005) to auto fill in the form. Can this be done? How?
View Replies View Relatedi have data likes this
post_month post_ year
january 2006
.
.
december 2006
january 2007
february 2007
i need to write a query to display as follows
january2006
.
.
december2006
january2007
february2007
Can someone please tell me how to add a year to the following date field from a SQL Server Database:
DatePaid = rs("DatePaid") & ""
I tried something like:
DateExpires = DatePaid + 1.
It certainly didn't work.
i wan to do a page at the backend,when the date is end of this year(12/31/2007) then will execute the code (such as add the new total leave with the current balance leave automatically without regresh the page or login into the system.)
i heard that the MS SQL SERVER got this triggered function, but unfortunately..the MS SQL SERVER hosting that i used(third party) didnt provide this function. i jz can store data in the table and create database..no more others component that i can use.
How can I select only articles from the current year? I have a datestamp column and the date it stored like this: 2004-06-18 00:00:00.000
The time is always all zeros so I have been having problems with it.
I have a date field in an MS Access database. I need to sort this field and print the results to an ASP page. I have done this plenty of times before except this time the date field data includes BCE data. A sample of the data in the date field is as follows:
1300 BCE
930 BCE
November 29, 1947
May 14, 1948
1465 CE
October 29, 1956
1020 BCE
I know that I can not have the data type of the MS Access field set to date/time. I searched online and didn't find too much.
How can I get the following date field to display as month and year only like "January 2004" ?
<%=(rsTitles.Fields.Item("Datte").Value)%>
I have an access db with 5 years worth of articles. I need to be able to list them according to year from a query string. I am having no luck with this. Can anyone help. SQL is not one of my strong points.
vyear = Request.QueryString("year")
strSQL = "SELECT * FROM tablename WHERE "& DatePart("yyyy", article_date) &"="& vyear &" ORDER BY article_date desc"
I have tried this a few different ways with no luck at all. I keep getting errors.
I have a date field in an MS Access database. I need to sort this field and print the results to an ASP page. I have done this plenty of times before except this time the date field data includes BCE data. A sample of the data in the date field is as follows:
1300 BCE
930 BCE
November 29, 1947
May 14, 1948
1465 CE
October 29, 1956
1020 BCE
I know that I can not have the data type of the MS Access field set to date/time. I searched online and didn't find too much.
Im working on a Year(Date) function right now, the output of that function is this "2005", my question is how can i change the format into this "05"
Function: Year(Date)
Output: 2005
Needed Output: 05
I need to make a countdown to the year 2004. I want it to have days, seconds, minutes, hours, etc.
The only problem is that my server is 3 hours faster than my time, and I need to adjust it in the script somehow, and also please give me the script for the actual countdown.
Here's what I have thus far:
<% =month(now) %> <% =year(now) %>
How can this be modified so that it, for this month, it would read:
August 2005
Also, how can I make certain there is a space between the month and the year without using a ?
How can I retrieve all the records from the database having the following parameter:
in form, these are the fields to be entered:
month (it's a select option)
year
Then from the database the field objrs("strDate")
Scenario: User entered the ff:
month = January (with the value 1)
year = 2004
if in the database the input for the strDate field is having this format: 1/2/2004
How can I retrieve all data for January?
is there a way to calculate the month from a week number and year?
View Replies View Related