Converting date to string

I have created a dddw with datatype datetime.  I want to populate a 
datastore with this dddw values.  I need the datatype to be of type string. 
 Therefore,I need to convert the date values to string in the dddw before 
it populates the datastore.  Can you help?
0
sscaplen
11/15/2002 6:05:23 PM
sybase.powerbuilder.datawindow 28057 articles. 4 followers. Follow

7 Replies
7589 Views

Similar Articles

[PageSpeed] 19

Do you want to populate the DataStore with the values in the dropdown itself
or the values from the column the dropdown provides values for?
Either way, you would walk the datawindow or datawindowchild,
GetItemDateTime, convert it to you chosen format using the String function,
InsertRow on the DataStore, and SetItem with the string.

sscaplen@marine-atlantic.ca wrote in message
<36E58F942389782C00635E7985256C72.00635EC785256C72@webforums>...
>I have created a dddw with datatype datetime.  I want to populate a
>datastore with this dddw values.  I need the datatype to be of type string.
> Therefore,I need to convert the date values to string in the dddw before
>it populates the datastore.  Can you help?


0
Jerry
11/15/2002 6:33:46 PM
String sDate

sDate = String([date_variable],"mm/dd/yyyy") //OR
sDate = String([date_variable],"mmm dd, yyyy")

whatever your desired date format
1
Russ
11/15/2002 9:06:10 PM
2 things:

1) You are not setting the dataobject of the datastore find
2) You are doing extra work by using a ddlb instead of a dddw

--
This is a FAQ, read Help, then search www.groups.google.com

pbm_thisusuallydoesnothelp:-))
Philip Salgannik

<Sherry_Scaplen> wrote in message
news:4BC500C1519E80A0004DC68185256C77.006B92DC85256C72@webforums...
> Can anyone tell me what is wrong with this code.  The dropdownlist box is
> empty when I run this code.
>
>
>
> datastore lds_find
> long i,ll_rowcount
> string sdate
>
> lds_find = create datastore
>
> choose case w_traffic_update.dw_1.dataobject
>         case "dw_voyage_info"
>
> ll_rowcount = w_traffic_update.dw_1.rowcount()
> FOR i = 1 to ll_rowcount
> sdate = string(w_traffic_update.dw_1.getitemdatetime(i,3), "dd/mm/yyyy")
> lds_find.insertrow(1)
> lds_find.setitem (i,1,sdate)
> NEXT
> ll_rowcount = lds_find.rowcount()
> FOR i = 1 to ll_rowcount
> ddlb_find.additem(lds_find.getitemstring(i,1))
> NEXT
> SelectItem(1)


0
Philip
11/20/2002 2:07:36 PM
Can anyone tell me what is wrong with this code.  The dropdownlist box is 
empty when I run this code.



datastore lds_find
long i,ll_rowcount
string sdate

lds_find = create datastore
 
choose case w_traffic_update.dw_1.dataobject
        case "dw_voyage_info"
 
ll_rowcount = w_traffic_update.dw_1.rowcount()
FOR i = 1 to ll_rowcount
sdate = string(w_traffic_update.dw_1.getitemdatetime(i,3), "dd/mm/yyyy")
lds_find.insertrow(1)
lds_find.setitem (i,1,sdate)
NEXT
ll_rowcount = lds_find.rowcount()
FOR i = 1 to ll_rowcount
ddlb_find.additem(lds_find.getitemstring(i,1))
NEXT
SelectItem(1)
0
Sherry_Scaplen
11/20/2002 2:09:31 PM
Have you stepped thru it using debugger?

On Wed, 20 Nov 2002 09:09:31 -0500,
 in powersoft.public.powerbuilder.datawindow
 <Sherry_Scaplen> wrote: 
>Can anyone tell me what is wrong with this code.  The dropdownlist box is 
>empty when I run this code.
>
>
>
>datastore lds_find
>long i,ll_rowcount
>string sdate
>
>lds_find = create datastore
> 
>choose case w_traffic_update.dw_1.dataobject
>        case "dw_voyage_info"
> 
>ll_rowcount = w_traffic_update.dw_1.rowcount()
>FOR i = 1 to ll_rowcount
>sdate = string(w_traffic_update.dw_1.getitemdatetime(i,3), "dd/mm/yyyy")
>lds_find.insertrow(1)
>lds_find.setitem (i,1,sdate)
>NEXT
>ll_rowcount = lds_find.rowcount()
>FOR i = 1 to ll_rowcount
>ddlb_find.additem(lds_find.getitemstring(i,1))
>NEXT
>SelectItem(1)
0
Austin
11/20/2002 2:24:39 PM
 How do you set the dataobject of the datastore find.
0
Sherry_Scaplen
11/20/2002 3:41:51 PM
The same way you do for datawindows.
lds_find.DataObject = "d_foo"

--
(`'�.�_/^\_�.�'�)
f e n t e r b u g
(�.�'��)^(�`'�.�)
      /   \
     ���^```
<Sherry_Scaplen> wrote in message
news:4471F856140F028A00563AC385256C77.0051C28485256C77@webforums...
> How do you set the dataobject of the datastore find.


0
Bug
11/21/2002 2:41:15 PM
Reply:

Similar Artilces:

How can I convert a Json encoded date to a javascript date string?
Hi, I'm trying to convert a date that was encoded using the Json() encoding function to a string representation of the date.  This is how I did it but there must be a better way...  Can anyone give me a few tips? function myformater(jsonDt) { //incoming json date string is of the form "/Date(946702800000)/" // Parse away the slashes ("/") and add keyword "new" var jscriptDt = "new " + jsonDt.substring(1, jsonDt.length - 1); // Convert the string to a javascript date var jdate = e...

Date time string error
Hi all, Just downloaded the club site starter and was hit with the following error on the events calendar page: String was not recognized as a valid DateTime. I have just taken a minute to fix it and thought i would share. The steps i performed are listed below: Download EventCalendar code from http://forums.asp.net/938287/ShowPost.aspx Copy the unzipped folder into my club site project Add the project into my club site solution Alter the method CreateDataBoundChildren(System.Data.DataView dv, Table table, DateTime todaysDate, DateTime visibleDate, System.Global...

Converting strings to dates
I'm looking for the best way to allow a user to enter a date into an editmask or single-line-edit in the format MM/DD/YY, then convert it to YY/MM/DD, so that it can be used to modify a where clause at runtime. Any ideas? TIA - Dave We have the same functionality in our application here. We handle it by storing the dates as dates, and applying the appropriate edit masks when we need them. When the user is entering the data, the edit mask for the date column can be MM/DD/YY. When you're modifying the where clause, concatenate using STRING( <date variable>, ...

Convert date from string
Hi Everyone, New at this and have been given the already implemented IDM to look after. I have an oracle database that sends me the DOB for a user as a sting (12/02/1978). The IDM system sets the password with this DOB but I'm not sure how to get it working properly. The rule is : <actions> <do-set-dest-password> <arg-string> <token-lower-case> <token-substring length="2"> <token-local-variable name="user_SURNAME"/> </token-substring> </token-lower-case> <to...

Convert string to date!
Hello, I got ASP.NET AJAX calendar and textbox in ASP.NET code. When I select a date on calendar and textbox value as following:txtEnterDate.text = "01/30/2009". I would like to convert this date string to date, so I can run query against with SQL Server database with date format is 2009-30-01 00:00:00.000Any help to making it would be appreciated. Thanks in advance. DateTime dateTime = Convert.ToDateTime(txtEnterDate.text); and then pass it to your sql... Please, Mark as Answer if this reply helped you===============Esayas Bekeleesayas27 at yahoo dot com I believe SQL wi...

cannot convert string to date
dear all, can anyone help since i still have no idea how to solve it. i'm using the popup calendar which is written in javascript , to get the date & display at the txtStartDate.Text and txtEndDate.Text - sucessfully worked. but i cannot pass the parameter to the cmd as below code and i get the error - Input string was not in a correct format, Cast from string "2003-08-19" to type 'Long' is not valid. Private Sub GenButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles GenButton.Click Dim c...

converting string to date
i want to convert a string to a date with format dd/mm/yyyy and use transact-sql syntax like convert(date, '01/' + convert(varchar(2),datepart(mm, v_fatura_tarih)) + '/' + convert(varchar(4),datepart(yy, v_fatura_tarih)), 103) it gives an error for convert... is it true? or any other way to do this? convert to yy/mm/dd i used below statement :- select @yymmdd = cast(@YY +'/' +cast(cast(@MM AS integer) AS char(2))+'/31' as datetime) musa wrote: > i want to convert a string to a date with format dd/mm/yyyy and use > transact-s...

How to convert a date to a string
How to convert a date to a string. I wanna put the result of "myDate.ToShortDateString" to a string variable. waiting for a kind reply... myDate.ToShortDateString() returns a string. To put it into a string variable, put: Dim str as String str = myDate.ToShortDateString Hope this helps, Russell Actually, I'm using this in my SELECT statement which is as following : Dim MySQL as string = "SELECT * from reservations WHERE pickup_date = " & myDate.ToShortDateString If I print this statement with Response.Write it shows : SELECT *...

Converting a string to date
I am converting a string to a date. I have 2 options, Convert.ToDateTime(string) or Date.Parse(string).Which is the better to use and why?   Use DateTime.Parse(string), because Convert.ToDateTime(string) merely calls DateTime.Parse(string). Well, almost: it also actually checks to see if the string is null/Nothing, and if it is it returns a new DateTime set to DateTime.MinValue. As this would probably be undesirable in nearly all circumstances, I'd stick to DateTime.Parse().RegardsDave Actually, I prefer using the style strings, gives you much more control: Format(strDate, "...

converting string to date
hi guys, i am having a problem converting s stirng to a date if my regional setting dd/mm/yyyy. my date column has to have a format and an editmask which is dd-mm-yyyy and the regional setting has to be dd/mm/yyyy or what ever the use wishes i get some value in string format i convert it to date and set it to the column The problem is even if i have a valid date sometimes it converts it to null date i have tried using pfc function also but it does'nt work even my ini setting sis having dd-mm-yyyy but it still gives me an error sometimes the problem is this phenomenon is not th...

convert string to date
Hello,I have a string representing a date and time respecting the following format "yyyMMdd HHmmss".How can I make a DateTime object out of it?!I couldn't figure it out how to do it using Parse, ParseExact or Convert.DateTime. I don't understand what the IFormatProvider parameter of those functions should be.Thanks for your help.  you can use the DateTime struct to Parse a string.  For example: string strDate = '01/01/2008'DateTime.Parse(strDate); my personal blog: http://www.protienshow.comPlease mark the replies with right answer as the answe...

Converting Date Strings
In a SQL database, I have a field storing a ToolPostingDate value (SmallDateTime, 4). In an ASP.NET page, I have this code: <asp:BoundColumn DataField="ToolPostingDate" SortExpression="ToolPostingDate" HeaderText="Posted On:" FooterText="Posted On:"> <HeaderStyle width="200px"></HeaderStyle> </asp:BoundColumn> A couple problems: 1. The date is being displayed on the page as "12/15/2003 12:00:00 AM" when I want "December 15, 2003" (no time). Is there an easy way to convert ...

convert from string to date
Hi I have a string containing 20/06/2007,I want to convert it to Date type Dim sDate As Date = "20/06/2007" But the following error appears: Conversion from string "20/06/2007" to type 'Date' is not valid. I want to save the value of sdate in a field of type smalldatetime in SQL SERVER 2000 Any help It is because you are inserting a date in dd-mm-yyyy format. and the sql server stores values in mm-dd-yyyy format.' Either you take all three values month, date and year and combine it and convert into mm-dd-yyyy format and store it in SQL.Please cli...

Convert String to Date
I have a database where the dates are stored as a string type ( ex. "010699") I need to selcect rows that fall between a given date range. I've tried: CONVERT(DATE,LEFT(stringdate,2) + '/' + SUBSTR(stringdate,3,2) + '/' + RIGHT(stringdate,2) ,1 ) >= :begindate AND CONVERT(DATE,LEFT(stringdate,2) + '/' + SUBSTR(stringdate,3,2) + '/' + RIGHT(stringdate,2) ,1 ) <= :enddate And I,ve also tried using CAST and the PowerBuilder DATE function All return this datawindow error: Select error: SQLSTATE = 07006 [SYBASE][ODBC DRIVER]:...

Web resources about - Converting date to string - sybase.powerbuilder.datawindow

Facebook Begins Converting Users To HTTPS
Are you willing to sacrifice a little bit of speed for a lot more safety? Facebook is asking that very question with its announcement that it ...

Facebook No Longer Converting Groups Into Pages
Back when Facebook first launched Facebook Pages, many businesses and brands who had built up substantial audiences in their Facebook Groups ...

Vert - simply converting for iPhone, iPad, and iPod touch on the iTunes App Store
Get Vert - simply converting on the App Store. See screenshots and ratings, and read customer reviews.

Converting SIM Card to Micro SIM Card - Flickr - Photo Sharing!
Place new Micro SIM into the iPhone SIM card tray

Ayaan Hirsi Ali on Converting Muslims to Christianity - YouTube
Complete video at: http://fora.tv/2010/07/29/Nomad_From_Islam_to_America_with_Ayaan_Hirsi_Ali Ayaan Hirsi Ali explains her support of missionary ...

Converting dry air to water: solution to Broken Hill's water crisis gains support
A one-man crusade by a Broken Hill resident to solve the historic town's water crisis by introducing air to water converters is gaining support. ...

Click go fears of converting print files
Is there a way to convert a print queue item to a .RTF or .PDF file? I like to save or email them. - The Sydney Morning Herald

Sudanese woman ordered to hang under sharia law for converting to Christianity gives birth
Khartoum, Sudan: A Christian Sudanese woman sentenced to hang for apostasy has given birth in jail, a Western diplomat said on Tuesday.

Imams warn against radicalism to Aboriginal inmates converting to Islam
The prison system has enlisted the help of ASIO to crack down on radicalisation behind bars amid revelations that Aboriginals are converting ...

Converting the world's companies one by one - The Science Show - ABC Radio National (Australian Broadcasting ...
Image: Trucks carrying logs make their way up a road in Jambi, Indonesia. A vast area of the Sumatran forest, and orangutan habitat, is being ...

Resources last updated: 2/12/2016 8:26:30 PM