What would be the best way to convert a month number to its corresponding string?
I.e, 3 -> 'March'.
Can I do this without using an array? I have a search function and the values of my months are in numbers so that they can be ordered correctly, but I need them to be displayed using their names, not numbers.
I need know the week nuber of the month. I know the function datepart() but returns the week number of the year a number between (1,53) I need a number between (1,4 o5). There is a function or method that i can use to do it?
I m having two combobox on my page cmbyear(years) and cmbmon(months). i want to make a check that if year selected is current year then selected month should not be greater than current month. how we can achieve this.
one way out is that we can store values of selected options in two variables in javascript function. In the function we can make the check that if selected value for year is current year and selected value for month is greater than current month then it ll show some error message and reload the page.
i m trying this but do not get results. May be i m having some mistake in syntax. can anyone tell me how to get selected value in a variable in javascript or some other way out to achieve this. I have applied same technique on text box value. its working fine. but with combobox. i dont know whats the prob.
When I select a filed from a txt or csv file, and display on the ASP, the 16 digit of barcode number (9876543210123456) becomes to 9.87654321012345E+15. How can I make it display the original.
How do I format a specific string and add dashes inside the string. The output I get from the recordset, for example, is 007275153. I want to format the output as 00-727-5153.
Also, if a string in a database is C-1411C1, how can I remove the "C-" at the beginning of the string?
I am trying to populate column values from an Oracle database into an HTML "Select" control. The column in the databases is defined as number. It is not working because I think I need to convert the value from the databases into a string variable first.
I have a string as "123.45" and want to convert it to 123.45 so that I can do some multiplication calculation. How do I do this so that it could work> I am really lost.
I'm reading through a txt file and using split to create an array of values. I need to convert one element in the resulting array from a string to a number.
However, none of the conversion functions such as CInt, CSng, Val work. I consistently receive a 'type mismatch' error.
I have a 20 character string that I need to format in a certain way. For instance, here is the raw string:
12345678901234567890
And I need it to look like this:
123-45-6789-01-234-5-67-8-90
It wouldn't bother me if the number was entered into a text box without any dashes, but then before I submit the number to the db I would need to enter the dashes in the correct spots. Can anyone give me an idea of how I can accomplish this?
Am collecting numerical entries from text boxes and converting to numbers using:
F1 = Round(CDbl(Request.Form("amout1")),2) F2 = Round(CDbl(Request.Form("amount2")),2) F3 = Round(CDbl(Request.Form("total")),2) F4 = F1 + F2
If F4 <> F3 Then Session("ErrorMessage") = Session("ErrorMessage") & "- Your control amounts do not tie to the Total Deposit amount.<br>" End if
etc.
Sometimes it works, but other times, although the numbers tie out, the calculated amounts are not coming up as equal. I've written the results (F3 & F4) to the screen and they equal, although the server doesn't think so.
Is this an issue with binary number conversion or something. Should I be using something other than CRnd (Delphi has something like C$ or CCurrency)??
If I keep a hard sql statment to show all records from 1 to 31 of each month will get error on months where there are no 31 days, how can i know the last day of the month ? any sql function or just via programming language? Using ASP and Sql Server 2005!
I have the following for the header in my table which should display "November", "December", "January" but instead I'm getting "November", "January", "December". Is it possible to do it like below or will I need to incorporate year in some way to that when it gets to these last months in a year it will know start back at January? Code:
<% DIM iMonth iMonth = Month(now) For x = 1 to 3 intMonth = Month(iMonth) Response.Write("<td align=center colwidth=""50""><b>" & MonthName(iMonth) & "</b></td>") iMonth = Month(iMonth)
I am wanting to retrieve the current date and submit to db in DDMMYYYY format. I have got it working but am now worried that if the month was January, that the value returned would be 2812003 and not 28012003.
Can anyone confirm that the below code will return 01(January) etc for the month instead of 1?
I need to insert some number into database as text. My problem is if I insert the number (ie. 4.0), the value in the database only show (4). So, is it possible to convert a real number into text number using ASP?
I need writing a SQL select statement. I know this one has to be simple, but I can't seem to get the query right. I need one query to select where the date range falls within the last 24 months, and a second query for data that's older.
I am trying to get my SQL Query to to through a list of faults, and pull all the records from the previous month (say now is july(7) it pulls all from june (6)
the current SQL i have is....
SELECT Faults.DateAdded, Faults.[Teacher ID], Faults.[Computer ID], Faults.[Type of Fault], Faults.[Description of Fault], Faults.Fixed FROM Faults WHERE ((Month([DateAdded])=Month([Date])-1));
I have an Access "date/time" column and I am trying to use SQL to select by month. I thought the code below would work (to query for records in april for example) but I am still getting all the records regardless of when the date is.
SELECT * FROM comm WHERE comm_requested_date = month(4)
Basically, I have a drop menu with the months and I want to query the DB for all records for a particular month.
Does anyone know of a formula that I can use to work out the number of days in a month not including the weekends?
I know I could probably use a loop that checks each day and if it is a weekday it adds to a counter but I'm guessing that would make things run a tad slower and the way this system is running I wouldn't want to make it any slower.
If I would like to get the week number for month, let's say today is July 25, 2005, which is the fourth weeks for July, how can I use base on the date I have and convert to get the week number in ASP.
I know the ASP/VBScript function for retrieving the current month - the Month() function. But how do i use this in a query to retrieve all records pertaining to a month?
For instance, my SQL Server table has a date field (TestDate) which stores the date when a test was taken by a person. How do I write a query that would pull all the records for tests taken this month?
Likewise, how would i pull for a week? I can't do a Date() - 7 because it has to be each work week..