Ask a Question related to Dreamweaver AppDev, Design and Development.
-
aDAMFOX #1
Displaying Date From a Database Record
Hi, Can anyone help??? I am trying to display the date that a record was
posted to a database to an asp page but it appears in the wrong format i.e.
Month/Day/Year and I want to be displayed as Day/Month/Year. Is there anyway
to do this as the date is Dynamic Text and I cant see how this can be changed
or if it is even possible. My Host says that as the server my site is stored
on is in Germany the date is in this format and they cant change it as I am on
a shared server. They are no help what so ever in giving me a solution
so................ Any help would be great Many Thanks Adam
aDAMFOX Guest
-
Only 1 record displaying?
Hi, I have a problem with Dreamweaver MX2004. I create my page as defined by the tutorial; connect to to my SQL database fine, displaying all the... -
Displaying the newest record first..
I know this is probably a brain dead question, but I can't remember how to display the latest database entry first, and the oldest entry last. Any... -
Displaying only a part of a record field
I would like to output only a part of a record field which is returned by a query. For example the outputed text would look like: "Drawing has... -
displaying a particular record in a particular location
Greetings, I am working with two recordsets and I wish to display the last record from one of those sets in a particular place on a page, and... -
Update Record only displaying first entry of database in the details page
Update Record only displaying first entry of database in the details page. It will update the record, it seems for some reason no matter what... -
Anthony Brown #2
Re: Displaying Date From a Database Record
In your bindings tab highlight the data field and use the dropdown box to
apply the desired format next ot it.
"aDAMFOX" <webforumsuser@macromedia.com> wrote in message
news:cv5nim$bg8$1@forums.macromedia.com...> Hi, Can anyone help??? I am trying to display the date that a record was
> posted to a database to an asp page but it appears in the wrong format
> i.e.
> Month/Day/Year and I want to be displayed as Day/Month/Year. Is there
> anyway
> to do this as the date is Dynamic Text and I cant see how this can be
> changed
> or if it is even possible. My Host says that as the server my site is
> stored
> on is in Germany the date is in this format and they cant change it as I
> am on
> a shared server. They are no help what so ever in giving me a solution
> so................ Any help would be great Many Thanks Adam
>
Anthony Brown Guest
-
RichMcCrea #3
Re: Displaying Date From a Database Record
there are formatting codes that one can apply using behaviors in dreamweaver,
but I prefer to format the date in the SQL. If you are going against SQL
Server, you can use convert(VARCHAR(10), tblname.datetime_fldname, 1) for
example. Hope this helps. Rich McCrea
RichMcCrea Guest
-
Billium99 #4
Re: Displaying Date From a Database Record
If you had control of the database, you could most likely set it to display the
autodate any way you saw fit. What database type are you using? Perhaps it's
possible to alter the data format for JUST your tableset in the db or some such
thing. Was this even an autodate field or is this user-entered date data? If
it's user entered, then you could simply break the date components out - month
field, day field, year field, and have much greater access over the resulting
format HTH Bill
Billium99 Guest
-
aDAMFOX #5
Re: Displaying Date From a Database Record
Thanks for the ideas, I tried the Bindings Tab when i select the date
datafield the Format title bar (Where it says Source then Binding then Format I
guess) is not highlighted so i dont seem to be able to change this. The
Database I am using is MS MSQL and the way the date is submitted is from my asp
page using Now function. Before when i tried to submit a date using this
function it was throwing up errors as on the 28/01/2005 (British Date Format)
the sql database said there is no 28th month (as the European format is
Month/Day/Year). My ISP gave me this code to place in an asp page called
global <SCRIPT LANGUAGE=VBScript RUNAT=Server> Sub Session_OnStart 'Global
session config's Session.LCID=1033 End Sub </SCRIPT> so i guess this
converts the date into the correct format for the SQL database??? i.e.
month/day/year ... but i am not sure. How would I use this
convert(VARCHAR(10), tblname.datetime_fldname, 1) and where would I put it in
my page Sorry to know absolutely nothing about programming Thanks Again
Adam
aDAMFOX Guest
-
aDAMFOX #6
Re: Displaying Date From a Database Record
I HAVE FOUND THE ANSWER... On the page displayig the records use this line of
code <%Session.LCID = 2057%> Which sets the format to be bitish and
displaying the date as day / month / year Thanks for the help anyway Adam
aDAMFOX Guest
-
aDAMFOX #7
Displaying Date From a Database Record
Hi I posted a question about displaying a date in an asp page with the
dynamic data coming from an MS SQL database. The date is displayed
month/day/year and I want the date to be displayed Day/Month/Year. Some
people gave me some help and i thought i had found the solution so marked the
question answered then found out I was wrong and so have created a new thread.
I tjhought that is i use the code : <%Session.LCID = 2057%> it would change the
date and it does to the format Day/Month/Year but now when i try and search for
records by their date posted it throws up an error saying value out of range.
as it is the 20/2/2005 and there is no 20 month (the sql database is set up as
Month Day Year). A User said to do this but i cant under stand what i a,m
menat to do with code or how it works 'there are formatting codes that one can
apply using behaviors in dreamweaver, but I prefer to format the date in the
SQL. If you are going against SQL Server, you can use convert(VARCHAR(10),
tblname.datetime_fldname, 1) for example. ' Can anyone help me Thanks Adam
aDAMFOX Guest
-
CarlGrint #8
Re: Displaying Date From a Database Record
SQL server by default sets the User language to US English which set the Date
to MM/dd/YYYY.
You can set the User Language to UK English which means it will except Dates
as DD/MM/YYYY this is something I always request or do myself on the live
database.
You could however when searching using the ISO Date format of YYYY-MM-DD which
will normally find the correct date however it is stored.
You could also when you search change the Search date of dd/mm/yyyy to the ISO
standard, so you don't have to enter it in the Search field.
varDate = Request("txtDate")
Dim ISODate
SDate = DatePart("d", varDate)
If SDate < 10 Then
SDate = "0" & SDate
End If
SMonth = DatePart("m", varDate)
If SMonth < 10 Then
SMonth = "0" & SMonth
End If
SYear = DatePart("yyyy", varStartDate)
ISODate = SYear & "-" & SMonth & "-" & SDate
You would put this code at the top of your results page before the recordset
which checks for the date records.
Originally posted by: aDAMFOX
Hi I posted a question about displaying a date in an asp page with the
dynamic data coming from an MS SQL database. The date is displayed
month/day/year and I want the date to be displayed Day/Month/Year. Some
people gave me some help and i thought i had found the solution so marked the
question answered then found out I was wrong and so have created a new thread.
I tjhought that is i use the code : <%Session.LCID = 2057%> it would change the
date and it does to the format Day/Month/Year but now when i try and search for
records by their date posted it throws up an error saying value out of range.
as it is the 20/2/2005 and there is no 20 month (the sql database is set up as
Month Day Year). A User said to do this but i cant under stand what i a,m
menat to do with code or how it works "there are formatting codes that one can
apply using behaviors in dreamweaver, but I prefer to format the date in the
SQL. If you are going against SQL Server, you can use convert(VARCHAR(10),
tblname.datetime_fldname, 1) for example. " Can anyone help me Thanks Adam
CarlGrint Guest
-
aDAMFOX #9
Re: Displaying Date From a Database Record
Hi, I tried to put your code in and it gave this error wheni search ed using
the date Microsoft OLE DB Provider for SQL Server error '80040e07' The
conversion of a char data type to a datetime data type resulted in an
out-of-range datetime value. /AadvancedSearchTestingPage.asp, line 88 I
understand what the code is doing splitnig the date and then into yy - mm- dd
but i dont see what the first line is doing varDate = Request('txtDate') I
can see it is declaring a variable varDate but what is Request txtDate is that
getting it from the form?? Thanks Adam
aDAMFOX Guest
-
CarlGrint #10
Re: Displaying Date From a Database Record
Yes, it takes the Date from a form element from a field called txtDate or a URL
value called txtDate.
Using Request means it will look for either Form value or URL value.
Originally posted by: aDAMFOX
Hi, I tried to put your code in and it gave this error wheni search ed using
the date Microsoft OLE DB Provider for SQL Server error '80040e07' The
conversion of a char data type to a datetime data type resulted in an
out-of-range datetime value. /AadvancedSearchTestingPage.asp, line 88 I
understand what the code is doing splitnig the date and then into yy - mm- dd
but i dont see what the first line is doing varDate = Request("txtDate") I
can see it is declaring a variable varDate but what is Request txtDate is that
getting it from the form?? Thanks Adam
CarlGrint Guest



Reply With Quote

