I am pulling legislation information and expiry dates from an access database and posting to the web. The expiry dates in access are formatted as Month Day, Year (EG.. January 1, 2006) But when they are pulled from the database to the web, they come out as 01/01/06. I know that the format we have in access is simply a mask, however we require that format be carried through.
This is likely a simple solution, however I am new to ASP and can't seem to locate any information on this. I have searched the forum for related info on this but can't find anything that relates to my specific situation.
Here's the code we are using so far...
Code:
<%
Do While NOT Recordset.Eof 'i.e. carry on looping through while there are records
Response.write "<tr><td>"'open row and first cell
Response.write Recordset("Legislation")
Response.write "</td>"'close first cell
Response.write "<td>"'open second cell
Response.write Recordset("Repealed")
Response.write " "
Response.write Recordset("Expiry_Date")
Response.write "</td></tr>" 'close row
Recordset.MoveNext 'move on to the next record
Loop
%>
I have also found and implemented the following code:
how to display data that I have in an Access Database to be formatted in paragraph style when I have it written to my asp page - but does anyone know how I can format text to display as bolded or to show http:// as a hyperlink?
i'm new here and i'd like to ask if there's someone who knows how to compare date() function and date from database with date/time type inside select statement so i don't have to do if..then..else
sql3 = "SELECT DISTINCT State FROM Property Where TypeID = '" & srch_cat & "'"
In the database, is a field called expiredDate I am trying to show only records whose expiredDates are greater than todays date, but I am messing up somewhere. The values in the fields are as this: 3/7/03 (or something like that...no time is added to it)
I have more than one date field on my ASP forms (and in the sister MS Access table) I can not write (created the record in Access table) to the table UNLESS there is date data in ALL the date fields on the ASP form.
I need to be able to have the user enter only one date, then do back at a later time and enter the other date.I am using the short date format in Access table (MM/DD/YYYY) When there is only one date field (on ASP form and in Access table) the date is written and the record is created.
I have an access database with year designations for field names, such 2005 2004 2003 ... and data corresponding thereto. I can formulate a query in MSAccess and it works just fine. However, I am trying to create a web page that will create a database connection and use SQL to create a recordset(s) which I can then manipulate in vbScript.
The problem seems to be structuring a query that will work in vbScript. I have tried several combinations:
rs2.Open "SELECT 2005,2004,2003 FROM Table", conn, adOpenStatic, adLockOptimistic rs2.Open "SELECT '2005','2004','2003' FROM Table", conn, adOpenStatic, adLockOptimistic rs2.Open "SELECT "2005","2004","2003" FROM Table", conn, adOpenStatic, adLockOptimistic
but none of these will extract data.
I have also tried casting these numbers to strings in a string variable, but still no success.
Is there some naming convention I am violating by simply using year designations as field names or is there a problem with vbScript?
I have an Access database with a date field The format that we store values is dd/mm/yyyy (greek)The problem is that i can't retreive the correct dates because the queries return only the english format dates. How to format the query to english date format (mm/dd/yyyy)?
Basically I'm trying to save and retrieve a UK date (dd/mm/yyy) to an Access database using asp. The database resides on a server located in the US
Things I've tried so far:
-- Specifiying Session.LCID both in Global.asa and individual ASP pages
-- Using Custom formatting to format date before entering into database (using SPLIT function)
-- Using custom formatting to format date AFTER retreiveing from database
The problem is that the date seems to change how it's stored in the database. If I entered "16/02/1982", it would be saved in teh database as '02/16/1982".. but if I entered "03/04/2005" it would save it as this.. So fomatting after retreiveing the date from the DB just messes everything up!
Does anyone have any ideas how to solve this other than moving to a UK server?
I have an ASP form that has a field that automatically places the current date into it. It uses the function Date().
The problem I am having is when the form is submitted into my Access database the date is coming out wrong in the Access field. The datatype for the field is Date/Time but it still is not coming out right.
Example: the date in the ASP form shows as 12/19/2006 and the entry in the Access form shows 12:00:27 AM. If I change the format of the Date/Time field to Short Date, the result is: 12/30/1899.
Does anyone know how I can get the data that is posted to the Access database to come out the same as the ASP form?
This is probably a simple question, but how does one format a table such that if a field is a certain value, then it will have a specific color.
For example, in the code below, if the specific field named "Year" is '2004' then I want it to appear in red, otherwise it should appear in black. Code:
I am using a Relational database for my site and i have the following tables:
FIXTURES, GAMEDATES
the fields in FIXTURES are:
GameDate Home Away
(All of the above are numerical fields)
the fields in GAMEDATES are:
DateID(integer) GameDate(#Date Field#)
What i have done is in the GAMEDATE field in the FIXTURES table i have used the ID number of the date that i wish to assign to that record - using a LEFT JOIN to display the actual date that is pulled from the GAMEDATES table (That which corresponds to the relevant id used in Fixtures)
The problem is that in some of my code i want to display records using sql and sometimes in the where clause i use the following:
WHERE Fixtures.GameDate<=(Date())
obviously meaning WHERE GAMEDATE is LESS THAN or EQUAL to TODAY.
The thing is when i use the join it does not use the where clause and displays all of the records in the FIXTURES table.
Does any one know how to get around this, i have not received any error messages it just isnt displaying the right data
I am trying to display dates in a spreadsheet, but the dates need to be in a format that will allow them to be sorted in Excel. The datatype in the SQL Server database is datetime. In this case, I need to display the date only, not the time. But I don't want to change the datatype in the database because the time is used in other places.
So what I am doing is pulling it out of the database, then modifying it in ASP/VBScript by using the datevalue function. This results in values such as 3/31/2006, 4/3/2006, and 4/14/2006. The problem is, the ones with the single digit date (4/3/2006 in the sample data I just listed) messes up Excel's sorting capabilities. How can I force the dates to display in a 2-digit date format? It would probably be good to do the same for the month.
I currently am showing Todays date on the page as follows: <%=Date()%>
I would like to show it in Day of Week, Month, Date, Year which normally I would show like this: <%=FormatDateTime(rstemp("StrDate"),1)%> where StrDate is a date/time field name.I want to do something like that with <%=Date()%>. Is there a way to do this?I am also using this to show Tomrrow's date also:
I know I could write one, but is there a built-in VBScript/ASP function to take a date, which is in the format mm/dd/yyyy, and put it in a yymmdd format?
I've got ASP to display the date in the format mm/dd/yy - i'm assuming thats the default value for date(). how to format that so it is in the form dd/mm/yy ? Or is ASP just returning the date format from however it is configured on the web server?
which sets local date/currency settings to UK. But despite this, a date entered as "28/01/1999" and stored in Access as "28/01/1999" is displayed as "01/28/1999". I haven't a clue whats happening.
I have a client that wants a time field to resolve to 7:00 PM rather than 7:00:00 PM (wants the seconds gone). vbLongTime provides the later but vbShortTime produces a 24 hour version or 19:00. Any suggestions?
I'm formatting the time that I'm storing. I'm trying to use:
riTimeIn = FormatDateTime(("timein"),3)
The problem is, since i'm using an insert i'm not using any recordset, so the code will not work. It will work like this (riTimeIn = FormatDateTime(rsdata("timein"),3) with the recordset. Do I just create a recordset.? Or is there away to get it to work without it?
I currently drag in a date stored as dd/mm/yy in my access database into a recordset and subsequently onto my asp page. What I want to do is format that string so that it returns to the html code dd.mm.yy - could somebody could help me out here?
I have a question regarding the date format. I am using an Access database as the backend. In Access there are only two formats, short and long.
Is there anyway to display the long date but without the day of week spelt out? In other words, I want January 24, 2006 and NOT Tuesday, January 24, 2006.
I have a field in my mysql database that is configured as 'DATETIME' and '0000-00-00 00:00', which i populate using the 'NOW() function, this returns a date in the format
2004-09-18 22:08:26
I would like to have this displayed in my web page as
Tuesday, 18th September 2004 at 10:08 pm (or something very similar)
The dates stored in my database are in dd/mmm/yyyy format but when it displays on the browser, it changed to mm/dd/yyyy format. Does anyone know what had went wrong??
I'm returning a date (5th Jan 2004) from Oracle using the following query:
select TO_CHAR(invoice_date,'DD/MM/YYYY') from...
This should return my date in the UK format, and it certainly appears to be doing just that in Toad. And it also looks correct in my form as it shows as:
05/01/2004
However when I submit my form I am having to convert the date to an Oracle format using this function: Code:
I'm currently entering the date into my date field using the now() function, which delivers this result: 2/2/2004 9:08:09 AM which is fine for some cases.
However, when retreiving this result, sometimes I'd just like to pull up the first part, such as the 2/2/2004 and cut out the rest. How do I take this date output, and format it to show only what I want? I'm writing all this in ASP.
I would like to generate a custom date format for my ASP output ... i.e.: "5 Apr 06" instead of the "05 April 2006" that the British English 2057 LCID automatically gives me. In other words, I would like a 3 digit month and two digit year.
i am having with my classifieds ads site, i am using Access. I little info first: every ad that is posted automatically includes the date it was placed, and on the actual ad page it shows when the user posted the ad and when it will expire.
the script always displays all date formats as so: mm/dd/yy however after using the following code in my asp files: session.lcid = 2057 it formats all prevouis ads like this: dd/mm/yy and that is what i wanted. Now here comes to the problem after inserting the above code every new ad that is posted on the site still shows the mm/dd/yy (us format) and i do not understand why.