Combine Dates
I have this code that will combine month day and year for some reason it puts the data in the database as January9,2005 February, 22,2005 . I need a space after the first month and I cannt figure out where the c
DateCovered1 = request.form("DatesCoveredMonth1") & " " & request.form("DatesCoveredDay1") & "," & request.form("DatesCoveredYear1")
DateCovered2 = request.form("DatesCoveredMonth2") & " " & request.form("DatesCoveredDay2") & "," & request.form("DatesCoveredYear2")
View Replies
ADVERTISEMENT
I am trying to display a random background image for a webpage. I found this code to do it
<%
'Defines the number of background images you have
Const NUMBER_OF_IMAGES = 2
'Initiates the randomize function
Randomize
'Sets a variable: this will be used to hold the
'random generated value
Dim intImageNumber
'This is where we create the random number
intImageNumber = Int((NUMBER_OF_IMAGES * Rnd) + 1)
%>
Modify the body tag to accept the random number. In this case we are going
to place it within the image so as to facilitate the selection of a random
image. Code:
View Replies
View Related
Right now i have multiple record sets. Im using the following Select statements:
How can I combine ClaimNbrSQL, ClaimCovSQL, and ClaimantSQL to pull data based on ClaimdraftSQL.
They have different Where_parts because one field is not accounted for in the innerjoins for the the last 3 selects. Anyone know of a better way of doing this? The problem is the queried table is not matched up correctly. For example if there are 2 rows where dft_mirco_ecd_nbr are blank, the ClamiantSQL is off by 2 rows. Code:
View Replies
View Related
I want to let users select one or more of my 5 choices in checkbox format, but also want to have a choice that is "all 5 choices". When "all 5 choices" is selected, I want to make sure they can't check any of the 5 choices. Is this possible?
View Replies
View Related
What I try to do is to combine 2 fields in one directly in a form before the 'submit' button. I use Access and Dreamweaver MX ( ASP VBscript).
In the form, the fields to combine are 'Course' and 'Schedule' to one field 'Course+Schedule'.
I know that we can combine fields in Access. But I need to combine them before to submit the form.
View Replies
View Related
May I know how to combine the text that get from textfield with the "strings" and insert it into database? Can anyone help me to check whether example below is correct or not. Any syntax error?
userid= request.form("userid")
emailaddress=userid + "@xxx.com"
insertsql= "insert into database(email) VALUES( '"&emailaddress&"')"
View Replies
View Related
I'd like to combine if possible these two statements drawing from a total of 3 tables.
sql = "SELECT p.Sub_ID, p.Cat_ID, p.Sub_Name, COUNT(c.Sub_ID) as ct FROM
Subs p LEFT JOIN Links c ON p.Sub_Id = c.Sub_Id GROUP BY p.Sub_ID, p.Cat_ID,
p.Sub_Name ORDER BY p.Sub_Name"
sql = "select * from Subs inner join Cats on Cats.Cat_ID=Subs.Cat_ID ORDER
BY Sub_Name"
Is it possible? Am I totaly screwed up for even trying? The goal is to count the relations ships in the Subs and Links table based on Sub_ID, to display needed data from the Subs table, and to display the Cat_name table from the Cats table in relationship to the Cat_ID in both the Cats and Subs Table.
View Replies
View Related
I want to take the contents of many fields of various datatypes (varchars
and text) and combine them into a single "junk" field that I will perform
SQL Server free text searching upon, e.g.:
tblArticles
Title
Subtitle
ArticleText
CombinedField [Title, Subtitle, and Article text smashed together]
Is it possible to create a query or T-SQL stored proc that would do this? Is
SQL Server DTS a better approach? It needs to be built for each row in the
table, and it needs to happen regularly.
View Replies
View Related
Is it possible to recall a variable with the combination of text + rs.field? i want to recall the variable "speler1", at the place weher rs("speler") is 1. It's probably again easy.
View Replies
View Related
I have 2 store procedure, I need to pass both into the asp page, and combine the result set of two. What is the syntax or the approach to do this.
View Replies
View Related
i have two numbers that i need to combine and then depending on the result i need to write different instructions to the browser. Code:
View Replies
View Related
I have several (three) CSV files each with different columns and dissimilar data. The only common column is transaction date. What I'd like to do is combine the data chronologically. I can't do a join query because the transaction dates do not line up from file to file and no other columns will match either.
I just want all the rows from the three different files put in chronological order in one place understanding that my columns wont line up since the source columns are different. I've exhausted every effort on the SQL side to combine these, but I'm thinking maybe there's a way to do it with FSO or something else.
View Replies
View Related
I have used thecode which is below to get x characters on to display
<%= LEFT(rsName.Fields.Item("columnname").Value,50)%>
It works fine but when I use this same code to get x characters plus display it using VBCRLF, with the <br> with writing the code :
<%=Replace LEFT
(Recordset1.Fields.Item("Detail").Value,VbCrLf,"<br><br>",50)%>
it gives me error so please can you tell me how can i trim the characaters and at the same time use VBCRLF. why does this above code with LEFT + vbCrLF doesn't work.
View Replies
View Related
I have several text files on my server and I would like to combine them into one text file by just appending each file to the end of the combo file. I know this should be possible, I just don't know how to approach it. Some combination of OpenTextFile and CreateTextFile?
View Replies
View Related
I have two variables:
UserLastName = request.cookies("UserLastName")
UserFirstName = request.cookies("UserFirstName")
and I'm trying to create a third variable that would strip the first letter of each of the above variables and combine them to create initials. Eg. if FirstName is John and LastName is Doe, the UserInitial variable would be "JD".
View Replies
View Related
I am using asp to submit a form I've created in asp. I was wondering if there was a way to output the vlaues of three listbox menus.
1. User selects hour
2. user selects minute
3. user selects am/pm
This is now outputting into my strBody as seperate entries. I'd like to combine them into one entry within the strBody.
Please reference strStartTime, I've tried to incorporate this into the email strBody, but am unable to accomplish this. Any help would be appreciated. Thanks Everyone!!!
Here is the asp code for the form: ......
View Replies
View Related
I've got a site managed in Frontpage and a forum in phpBB/MySQL. I'd like to grab the most recent posts from the Announcements Forum and embed them in the site's homepage. I got the idea from http://pocketpcthoughts.com/ . All of their homepage posts are fed from their FrontPage Archive Forums.
Right now, I'm using a phpBB mod called FetchAll to do the job. It works great except for one thing: I have to do it via an inline frame because I can't include a PHP file in an ASP page, and I have to use ASP because the site is in Frontpage (project requirement; FP is essential to the non-forum part of the site). Code:
View Replies
View Related
I have added a db driven marquee to my site and need to combine the global asa's to 1 global asa file. Code: ......
View Replies
View Related
i have an admin page where i have to enter dates.
I enter them in french format : month/day/year, i save, when the page is reloaded, they appear in french format, "day/month/year"... if i save again, they will ve swapped again.. and so on....
what i'd like to know, is how to know the database supported format, the server date format and how to correct this little problem in my task management system i am developing.
View Replies
View Related
lately i just migrate my website to a US webhosting (i am from malaysia) and since then the date is 13 hrs behind.
Understand that to solve this problem i will just need:
DateAdd("h", +13, now())
and the output will be:
4/16/2006 12:30:03 AM
The question is how do i just get 4/16/2006 (without the time)?
View Replies
View Related
I have this query:
SELECT COUNT(appold.reason) AS Insufficient_Information
FROM appold
WHERE appold.reason LIKE 'Insufficient Information' AND (appold.`date out`
BETWEEN MMColParam1 AND MMColParam2)
MMColParam1 #01/01/2003# Request.QueryString("date1")
MMColParam2 #20/01/2003# Request.QueryString("date2")
and using this link to set the values:
page1.asp?date1=#01/05/2003#&date2=#30/05/2003#
When I test this in the recordset dialog it shows up with the correct count but when I use the link as above I get a 0 count, what am I doing wrong?
View Replies
View Related
I am writing an app that uses ..Now()...
How do I allow for time zone differences?
If I understand, Now() pulls the server time.
View Replies
View Related
I have a form with 2 fields: Beginning Month and Ending Month. I want to be able to allow the user to select a beginning month and ending month and when they hit submit, it will retreive all records in the table where the month field is equal to or inbetween the months the user selected.
For arguements sake lets set:
strBDate = Request.Form("txtBeginDate")
strEDate = Request.Form("txtEndDate")
SQL: SELECT tb_admin.[Session#], tb_admin.Date_from, tb_admin.Date_to FROM tb_admin WHERE ????????? ;
I know how to connect to the database and pull the data using SQL and WHERE statements but im not sure how to form this WHERE statement.
View Replies
View Related
When I try to select records which have a date greater than todays date it brings back the incorrect records. I think I'v tried everything to get it working and may have missed something. Basically here's what happens.
Todays date is 04/05/2005, but the sql will return records which have a date of 05/04/2005 or greater. Heres the sql:
Select * From trainingCalendar2 where startDate > #04/05/2005# Order By startDate;
And Returns:
2 Course Test 4 07/04/2005 Mandatory Training
10 SAP Training 29/04/2005 External Course
12 Create Course 2 17/05/2005 Internal/Upskilling
I have checked the regional settings and they are correct. When I open the database and look at the records they are of the correct format.
Even when I look at the records in the site that are the correct format. I think it's access but I thought that access was supposed to have the same regional settings as the computer.
View Replies
View Related
Ive got a variable in my code which is used to calculate the age of an entry in the database. The runtime value for the variable is set to Now-14 which checks to see if the article is more than two weeks old. I can change the value to Now()-21 and it still works (flagging all items 3 weeks or newer, but if I increase this to 28, 30 or anything above,
View Replies
View Related
im using date()to return the date in the format dd/mm/yyyy is there any way of changing this to yyyy/mm/dd and the next question is what is the correct delimiter for date in sql statment is this correct?
sSQLinsert into productioninfo where Entry_date = #" & mydate &"#"
View Replies
View Related
How can i add "0" on Months and Days in ASP...What I want to happen is when it saves
to the database it saves 09/01.. this is my sample code:
Day(Request("DateReceived")) & "/" & Month(Request("DateReceived"))
On the code it only return the value 9/1.
View Replies
View Related
i have a page which allows the user to enter an amount of holiday for a year. so i have a inputbox and a submit button. user details are kept in a sql server database in a table. and one of the fields is startdate.. which basically when the user starts using this system he has to enter his personal details and which one of them is the startdate field.
i need to create a function of something that allows me to add the number 5 to the amount which the user adds for a holiday year. This only done once therefor if the users start date exceeds 5 year i need to create a function to add the number 5 to it. the code which i have at the moment ... basically selects the user from a View which i have in my sql server database. obviously it retrieves the users.. record.. depending on what the user inputs as a holiday number in the input box and then it is updated into the table in my database.
View Replies
View Related
I have a problem I'm trying to find the difference between 2 dates in a form. I would like textfield3 the differnce between the dates.:
<script language="JavaScript" type="text/JavaScript">
<!--
<!-- Begin
function calc3() {
numtextfield3 = (document.Form1.textfield1.value -
document.Form1.textfield2.value);
document.Form1.textfield3.value = numtextfield3;
}
// End -->
//-->
</script>
I keep getting an error what I want is if:
textfield1 = 12/03/03 12:05 and
textfield2 = 12/03/03 11:10
View Replies
View Related
I need help with selecting records between certain dates from an Access 2000 db. The dates are held date type in the short date format so they look like so 16/03/2004. I've done the following SQL statement as a test to try and pull out everything from today until a specified date. It does nothing at the moment, the page just renders with no results and no errors.
Code:
strSQL = "SELECT * FROM events WHERE StartDate <= 16/04/2004"
View Replies
View Related
After moving a small web app to Win2k3 / IIS 6 the date is being displayed as DDMMYYYY, rather than MMDDYYYY. Can I change something in the regional settings to correct this? Or do I have to change the source?
View Replies
View Related
Basically I have a date that a person completed an exam. A retake date is set off of this completion date (I grab the date and add a certain number of months - i.e. 24, so a completion date of 01/01/2007 would have a retake date of 01/01/2009.)
I'm generating a report for supervisors to be able to look over the employees test history to make sure that the employee is up-to-date on testing.
I want to be able to compare Retake to the current date. If the retake date is in the future (or on the same day - if someone were to look on 01/01/2009) then the employee has a "satisfied" next to them. But if the retake date is in the past, then there is an "incomplete" next to their name.
View Replies
View Related
I am trying to put together a little code that will take the current date and add X number of weekdays to that date.
For instance, if it was a tuesday the 10th, the script would return Friday the 13th. If it was Friday the 13th then the result would be Wednesday the 18th. Basically I need to know where to start with offestting dates based on weekdays
View Replies
View Related