Displaying Time Using DateAdd()
I need to display on a web page a 7 day week split up into 30 minute blocks.
I have written the code below to do this. No doubt it is a load of rubbish (I know the bit that prints the days of the week is, but I'm not worried about that for the moment, I'm more concerned about getting the times correct).
The problem is that I cannot get it to print out midnight. The day starts at 00:30:00 and ends at 23:30:00.
Looking at the code below, can anyone suggest how I might be able to do this please?
I know I could just type in something like:
<TD>00:00:00 AM</TD> manually, but I want it to go in via a loop so I can compare it against data that will eventually be pulled from a database.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Displaying Date Time
With the following code I am trying to simply set and display the current date time in an input box. The input box will not accept a variable that contains any spaces (i.e., a space between date and time). It works if I hardcode a date time, but I need the current date time. The code also works as long as it is not within an input box (see 3rd line below) <tr><td align="right"><strong>Start Time:</strong></td><td align="left"><input type="Text" name="Start_Time" value=<% =now %> /></td> *THIS ONLY DISPLAYS DAT <td><% =now %></td> *THIS DISPLAYS BOTH DATE AND TIM </tr
Displaying A Database One Column At A Time
I know how to write a script that will show all the tables fieldnames and then all the tables fields, but how can I do it so that it shows the database table one column at a time? for instance: fieldname 1 <br> 1st fieldvalue for this column 2nd fieldvalue for this column 3rd fieldvalue for this column <P> fieldname 2 1st fieldvalue for this column 2nd fieldvalue for this column 3rd fieldvalue for this column etc..
ASP DateAdd
I'm trying to compare two dates, All I need to see is if the first date is greater than the second date. I'm fimiliar with how the DateAdd works, I use it often in my SQL Stored Procs, but for ASP it doesnt want to return a value Here's an piece of the code: If DateAdd(d,DateDiff(d,0,BookingDate),0) > DateAdd(d,DateDiff(d,0,EndDate),0) Then Flag = 0 Else... I've also tried just printing out the literal value of the expression but that doesnt return anything either. Test = Cstr(DateAdd(d,DateDiff(d,0,BookingDate),0)) Response.Write("<b><font color='0000ff'>" & Test & "</font></b>") Can anyone tell me what I'm missing here?
DateAdd
I'm trying to code a drop down for a date entry that gives the user the option of the current date plus the dates of the last 7 days. <% for i = -7 to -1 Response.write "<option>" & DateAdd(d,i,Date()) & "<option>" next %> Besides this, even the following code generates an error: Today=Date() Response.write DateAdd(d,5,Today)
DateAdd Function
This sort of stuff really gets me!I've been using the DateAdd function in various places to return results from the last 3 months e.g. Code: SELECT * FROM table WHERE publicationDate > #" & DateAdd("m",-3,now) & "#" It's been working fine until today when I get into work and suddenly no records are showing up.If I substitute a date from 3 months ago for the function, the records reappear.
Dateadd And Convert Date Problem
Does any one know how I can use DATEADD and COVERT in the same select statement for retrieving data from a smalldatetime field? I want to retrieve a date, add a year to it, then convert it to dd/mm/yyyy format without the time showing. It works seperatly EG: convert date - SELECT adId, CONVERT(CHAR(11),datefrom,103) AS datefrom1 FROM ... Add date - SELECT adId, DATEADD(year, 1, datefrom) AS dateto FROM.... How do you combine the 2 statements? I have been going slowly mad trying to figure this out I’m using ASP3.JS and MS-SQL db
ASP To Re-load Page From Time To Time To Reset Varaibles
I have a website that I subscribe to that allows me to track tasks. I have an extra computer with a big monitor that i want to always display the task list. the problem is after so many hours I get logged out. I need to need to reload that sign in url every few hours Code:
Comapring Database Time And Computer Date/time
there i was just windering how do i compare a date/time vlaue in sql server agaisnt the computers' date/time. for example, if computer date/time is two months or 2 weeks before the database date/time do something
Time/Date Format And Changing Time To GMT
Currently working on a ASP for a friend, which requires the date and time on it. It pulls in entries from an Access Database with dates and times in the format of: "Fri Oct 17 18:02:46 2003" However my date and time on the ASP page is displayed as: "Friday, October 17, 2003 18:02:46" using the script: "<%Session.LCID = 1033%> <%=FormatDateTime(Date(), vbLongDate)%> <%Session.LCID = 2057%> <%=time()%>" Anyone know how to change this script, fully or partly to produce the date and time on the format that's in the access database i.e. "Fri Oct 17 18:02:46 2003" Code:
Time Convert String To OdbcType.Time
I am working on a database that collects information about incidents. One of the fields that people enter is the time of the incident. I am trying to convert that string that people enter into a OdbcType.Time and I am at a lost.
Time Function Returns Wrong Time
When the Form is submitted I use the Date() and Time() functions to put the date and time into the Body part of the e-mail. The time reported is three hours earlier than the time at which the Form is actually submitted. I understand these functions are evaluated on the server so the server must be in a time zone three hours earlier than where I am . Is there any way I can get the local time at the location where the user is actually located. ?
Compare The NOW Time With A Deadline Time
I am trying to compare the NOW time with a "deadline" time. Please help. Just not sure why this is not working. I need to be able to say IF IT'S BEFORE 9:30 TODAY, IT'S OKAY TO ADD SOMETHING. IF IT'S AFTER 9:30 TODAY, YOU MUST ADD IT TOMORROW. CODE: nowtime=now() deadlinetime=formatdatetime(now(),2) + " 8:30:00 AM" response.write "NOW: " & nowtime & "<BR>" response.write "Deadline: " & deadlinetime & "<BR>" if nowtime<deadlinetime then response.write "can send out today" end if if nowtime>deadlinetime then response.write "must send out tomorrow" end if RESULTS: NOW: 1/18/2007 8:51:43 AM Deadline: 1/18/2007 8:30:00 AM can send out today As you can see, NOW is GREATER THAN Deadline, so it should must send out tomorrow.
Displaying XML
I have XML and XSL documents stored in SQL Server 2000 field. On the asp page i will be getting these documents from the database and then displaying the content of the XML document according to the XSL on the asp page. How can i do this? Also after getting the documents from the database do i need to store these on the server as .XML and .XSL and then read through these or i can directly read from these document without saving these physically. Archived XML and XSL documents are attached.
Displaying //
I'm pulling data into ASP from Sybase IQ. When the data is in the database its displayed correctley: //C://.... When I pull it into an asp page, the formating changes, and a few of my slashes disappear. Is there a special method of pulling slahes into asp?
Displaying Message Box!
I have a requirement to display a message and then redirect the controls to some file, I tried with the below method but its not working, where as If I use server.transfer or server.execute it works but I cant give relative Url (it will dynamically genrate), If any one has an alternate way, pls respond. ShowMessage("Hello World") Sub ShowMessage(sMessage) Response.Write "<script> alert("& Chr(34) & sMessage & Chr(34) &" ); </script>" Response.redirect "xyz.asp" End Sub
Displaying From Recordset
i have a set of details in the database that looks like this: Name Number ------------------------- ABC 123456 ABC 128556 ABC 125559 DFF 559851 DFF 448715 DFF 154873 how do i select then in such a way that they are display like this on the asp page: ABC ------------------- 123456 128556 125559 DFF -------------------- 559851 448715 154873
Displaying 2DP In Textboxes
When I retrieve this data into standard text boxes (using ASP/ADO) so that the user can update/file the following problems occur on what I would call price fields: 10 << I want 10.00 11.6 << I want 11.60 12.89 << this is fine My MySQL DB holds prices as decimal(10,3) so I know the decimal data isn't chopped at this point. Before the data is displayed in these boxes I created the below function to parse the data before it is written to the boxes: Code:
Displaying An Image
I'm sure I'm missing something completely obvious, but I can't figure out what. I have a path to an image file stored in a database. I'm trying to align the image to the right, but nothing seems to be working: Response.Write("<img src='" & rs("faculty_link_to_photo") &"'>") dispays the photo without any wrapping, but when I try the following, the images go all over the page: Response.Write("<img align=""right"" src='" & rs("faculty_link_to_photo") &"'>") Can someone tell me what I'm doing wrong?
IMG Tag Not Displaying Image
I have ASP (classic) code that writes out a table and sets the <img....> tag with a virtual directory source, e.g. src='/test/imghold/xyz.png', and the images do not appear on the IE page. The code is from a production site that works fine. We just duplicated the web site to one named test and now the images do not display. The IMG item is in a TD element of a table. Also, I looked at the "view source" of the page and it shows the <IMG src='/test/imghold/xyz.png'...> just fine. I even tried it with different images and none of them show up.
Pictures Not Displaying
I have a web page that displays properties for sale. The web page links to a database. The page shows information in the database and the path to the picture. The code is: <p><img border="0" src="file:///D:/HousePics/<%response.write rsData("id")%>.jpg" width="350" height="262"></p> the rsData("id")% gives the name of the picture file and appends .jpg to it. When I browse the page on the local machine the page displays ok and the graphics show up ok. When I browse to the page at work the grpahics don't show. Permissions on the folder 'everyone full control', web sharing is enable for the site.
Page Not Displaying
Following is a function on button click event to display the details of an user.if i include this function page is not displaying.can u tell me where the mistake is? Code:
Movie Displaying
I done Internet presentation for my client and presentation is placed on Brinkster... Displaying movies is a part of presentation... Those are .mov files... As movie container I use Quicktime... My problem is: I have to wait to full movie loading... Wait and wait... When the movie is loaded then display starts... Sometimes, it can take a long time... I want to achieve effect with movie slider in my Quicktime container... In other words, I want that movie begins to play before the end of full loading... How can I achieve this? My code is here:.....
Displaying Pictures...
This code displays all the pictures in a defined folder as thumbnails. That works fine. But I would like to have it roll over onto a new page after a certain number of thumbs have been displayed and a back forward message. Code:
Displaying Appropriate Fields
I have a loads of records in an Access database relating to publications. The publications come in 3 forms, pdf, Word or .htm so I have fields for each called PDFurl, Wordurl and Publink. What I want to do is, if any of those fields contain a value then display an appropriate icon (which will link to the publication). I'm ok with the latter part but how do I determine if any of the fields have a value and if so display the relevant icon? Rather than do a load of if then statements I was wondering is there a quicker way of doing this, perhaps using a Case?
Displaying Data
I thought its more space efficient of displaying the data in multiple columns (let's say 2 columns for now), instead of one loooooooooong column in a table, are there a simple script of coding that can do just that? How about 3 columns?
Displaying RSS Feed
Firstly, I am not a programmer, so forgive my complete and utter ignorance of all things ASP related.I am trying to display an RSS feed on a website using some ASP which I found on this website - http://www.tele-pro.co.uk/scripts/rs...d_class_dl.htm I have downloaded the script and running it locally it works (kind of):- However, when I put this page on my web server I get an error message:- http://www.ubsigroup.com/testing/ The ASP file is here:- http://www.ubsigroup.com/testing/rss...ed_class.1.txt
Displaying SQL Data
I have a fairly simple (at least in PHP) request but I can not find how do do it. I've seen things that are kindof what I want but not really. Here is what I want: I have a ton of data in a DB. I want to pull some of that data and display it in a table. In PHP I would create a SQL query called $Result "(SELCT * FROM whatever)" and produce this code:
Asp Variables Not Displaying
I have an asp page in which I am performing the following: 1. Querying a database view 2. Returning rows in to a recordset. 3. Looping thru the recordset and printing the data 4. Before displaying the data I am assigning the values from the recordset into variables 5. There are 2 entry points to this page both of which would run similar queries and return similar results My problem is that for a certain sequence of variable assignments, my data is not displaying on the screen (even though when i do a response.write I see that the variable actually has a value in it). In order to fix it I rearranged the sequence of assignments but since I have two entry points to the page, it didnot display the data for the other entry point.
ASP Page Not Displaying
I have IIS 5.0 configured in win2k server. When I browse a html I have no problem. But when I browse an asp page, the browser is hanging around.
Displaying Date
I only just noticed this on a peice of work i completed. I used JavaScript and ASP to complete the project. A line of my code - Response.Write("<td align='right' class='results'>" + MyQuery('Date') + "</td></tr>"); was used to show the date (readign from an access database) on the page but the output which was returend in the browser was - Thu Jul 25 00:00:00 UTC+0100 2002 instead of the date the format - 25/07/2002 is there anyway i can change this so it displays ont he page exactly how it is shown in the access database
Displaying Content
After a user selects the 'answer' hyperlink, the answer will be pulled from the database and displayed. Then i would like another link once selected to remove the displayed answer from the screen. It is important that the answer is not permanently deleted from the database. I would like to do this for a series of questions.How can i do this?
Displaying Of Contents
I am currently working on ASP. Users will input their contents into a textarea. The problem is that when they input and I retrieve them from the database, they will use the textarea space that was allocated to them and display exactly it is. For example the text area given is 500px and i only give the display part of 250px. Despite that, it will fill up and scrollbars will appear on my bottom of the webpage and have to scroll to the right. how i can display all text with the break lines in between yet still confined to the space of 250px.
Displaying Different Data
Is it possible to show different information on a page for different users? For example a first year student that needs to select modules for this year compared to a second year student how would have to select different modules.
Displaying TextArea
I am trying to display data pulled from a sql db in a text area. The field in the db is of type ntext. I am printing the data using the following code..... <TEXTAREA name="HTML" COLS=100 ROWS=21> <%Response.Write(rsCreativeElement("ElementHTML"))%> </TEXTAREA> But this is printing as <Long Text>, how can I print the actual data from the db.
Displaying A Textbox
I have a form that has a dropdown list. I would like to have a textbox be displayed after the user chooses "other". How can I do this? I would also like the field to go away when the user chances their mind. Is this possible?
Displaying Status
I am wondering if this is possible. I have an ASP page that calls a stored procedure (MSSQL). I want to display the status on the ASP page as each process is executed on the Stored Procedure and ASP page. For example, when I connect to the database, show the user that a connection has been made or in the stored procedure when some tables are updated to show that.
Image Not Displaying
It is not displaying the image thepicture. It is in the directory. I also have a similar bits of code for a other pictures with of and they is working The response write displays the correct reference. The alt displays instead of the image as though the image has not been found and as I said the Code:
Displaying A PDF From A Webpage
I have a requirement to fire up a PDF brochure for visitors. This is currently done by simply linking the pdf document direct using a javascript popup and hence acrobat is invoked when the link is clicked. I now have a requirement to trap and record in my database the fact that the brochure was viewed and I can't get my head around how I can do both without getting the user to click 2 links (one to fire up the page with the ASP database call in it and a PDF link on it, and the other to click the PDF). I have a feeling I could do something clever with host headers, but before I go too far down that deep and murky path I wonder if there is some simpler way I'm overlooking. Current Code :
ASP/HTML Not Displaying
I have two folders in inetpub/wwroot. One has all HTML code, the other has HTML & ASP pages. The pure HTML files show up in IE6 just fine. The other pages just say done with a blank page. I had servral files that were ASP pages but only had HMTL code and changed the extension to HMTL and still get blank pages. Not sure why these pages do not display but the other directory does. Both folders have the same rights configuration (scripts & executables). I am using IIS 5.1 on XP SP2 machine and I Have all updates installed. If I open these sites in FrontPage they both work fine. I guess FrontPage handles the code itself and does not use IIS. I am tryint to relearn my ASP & HTML and I need to get this working,
Displaying All Records
How do you display all your fields from an SQL table in a web page - BUT make them clickable to make any changes??? E.G. I have a users table with firstname and surname in, but I wish to amend the surname?? I know the code to amend the changes, but dont know how to display the records and make them clickable!!!
Displaying A Record In .asp
I am currently trying to write an internal web stats page that people can view by clicking the relevant link and then it opens a new page that diplays the corresponding record. i.e. the initial page has a list of Companies, once the company name is clicked on, then a new page is opened, displaying all the relevant information to that company. DSN = switch_login table = Client_Info_Table Any and all help is more than appreciated, am having real trouble getting it to work, I know it probably something simple.
Displaying Records
is there a code or query that i can use to display everything but the first record? here's my sql: sql = "SELECT * FROM Hotstory ORDER by DateTime DESC" what i'm using to display: Response.Write("<a href=' " & rs("URL") & " 'target='_blank'>" &rs("Title")&"-"&rs("DateTime")& "</a>")
Displaying The Next Seven Days
the script below writes the next seven dates and their weekday names. it works a treat, until it gets within seven days of the end of a month. when that happens, the number of days shrinks and shrinks until the 1st of the next month, when it goes back to normal. my question is - what needs to be changed here in order for it continue displaying dates into the next month? Code:
Displaying Records
I was wondering if anyone would be able to help with the following; I have a database which contains a list of products with prices and a set of variables. I'd like to store the product prices as session variables....
Code Only Displaying
I was just wondering if anyone else has had this problem? I am displaying records from a database and when I hit F12 the page displays ok. However when I link the page to the main page and click on the hyperlink the page appears in code view and I was wondering if anyone knew how to solve this problem.
Displaying Graphs
Does any one perhaps know how to display data from a db in a asp page in graphs, or perhaps know of a resource where I can find more information on this topic?
Displaying Tabs
i use the following code to retrieve text from access database using Dreamweaver: <%str = replace ((RS1.Fields.Item("Text").Value), vbNewLine, "<br/>") Response.write (str)%> (above code just wraps the text by inserting lines) However, when i have tabs inserted inbetween text, it does not display it on ASP page. how can i have the tab viewable when i retrieve data?
Images Not Displaying
response.write FilePath gives this path, ImageName.jpeg but the image(s) doesn't display in the below code. What am I missing..? Cheers. <%Response.Write FilePath%> Original Image:<BR> <IMG SRC="<%=Server.MapPath("ImageUploads") & FilePath%>"><P> Thumbnail (50% reduction):<BR> <IMG SRC="<%=Server.MapPath("ImageUploadsThumbsThumb") & FilePath%>"> The files definitely exist in the database.
|