order by convert date

why i can't order by convert(date) in sql
0
aaa
10/20/2010 3:18:47 AM
sybase.sqlanywhere.ultralite 2982 articles. 0 followers. Follow

1 Replies
536 Views

Similar Articles

[PageSpeed] 49

Hi,

This should work fine.

Please tell us what product (UL or UltraLiteJ) and what version you are 
using. Also what platform and language.
Please supply the SQL statement and applicable schema (as create table 
statements).

- Tim

<aaa> wrote in message news:4cbe5f97.6ba3.1681692777@sybase.com...
> why i can't order by convert(date) in sql 


0
Tim
10/20/2010 8:04:42 PM
Reply:

Similar Artilces:

Convert Date and order by
Hi!I have a little problem. I’m trying to sort a date I have converted like thisConvert(datetime,LH.LoginDateTime,103) as RegistrationDateBut when I use Order by on RegistrationDate it only sort on days:01/11/200601/12/200602/11/200602/12/200603/11/200603/12/2006I’ll guess it’s because of the “varchar” convert, but I need the date to bee inn this format, since I only shall check the date and not the time. Is there a way around this, so I can order it like this? (Se under)01/11/200602/11/200603/11/200601/12/200602/12/200603/12/2006Sample SQL;select Convert(varchar,LH.LoginDateTime,103) as Reg...

convert date christian date to persian date
hi, I need to convert christain date that was produced in my Sql database to persian date like" دوشنبه 21 مرداد 1378" in a datalist.Could you recommend me any function.I use VisualStudio 2005 & VB. thanks in advance Sepid Take a read of http://www.codeproject.com/KB/database/PersianDateInSQLServer.aspx or maybe a javascript route like http://www.codeproject.com/KB/gadgets/PersianDateViewerGadge.aspx Hope it helpsRegardsJeremyIf this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.That way future readers will ...

Dates, Dates, Dates!
Hello all... I am in the process of building an appointment system, and I am trying to see if I can get some pointers on which way to go on this. The first version of this appointment system was very lo-tech, and it stored all of the possible dates/times in the database. Once a user booked an appointment, their information was logged to that date/time, and then that date/time would no longer show in the list of possible openings. This was great for a temporary fix, but with having to pre-populate all of the dates/times, the system would eventually have to be updated to continue on pa...

date format, date order
SQL Anywhere 9.0.1.1751 I have a .csv file that is HUGE. It contains dates in the form of 'mm/dd/yyyy'. I need to import this into a ASA 9 db. I cannot open this in excel and edit the dates because it will cut off some data. I'm going to need to do this on the SQL side. I've tried... SET OPTION DATE_ORDER = 'DMY'; SET OPTION DATE_FORMAT = 'MM/DD/YYYY'; ....it still will not recognize it. There has to be a way to do this, right? Steve wrote in news:42e8166b.4653.1681692777@sybase.com: > I've tried... > > ...

Convert Date/Time to Date
Hi I'm using .NET 2.0 framework with a Postgres DB. I'm getting date values from the table 'creationdate' and I need to compare it with other date value (given by me). The thing is that tha date returned from the DB comes like this '27-03-2006 0:00:00' and the date value that I use to campare comes like this '27-03-2006'. I want to know how to convert the returned date value from the DB to date only...?! I tried using the following: SELECT CONVERT(char(10),creationdate,101) AS date FROM calendar.events WHERE date = "myDate"; but it gives me an error: syntax error at or near "," at c...

HELP- SqlAnyWhere X SqlWindows(cannot convert to the date/time)
Does some way exist of converting the type Date/time of SQLWindows for Timestamp of SqlAnyWhere? (using bind variable certainly) When I use bind variable of Centura type Date/Time, in the insert, in the update or in the cluasula where of the select. (Example: Call SqlImmediate('UPDATE g_acidente set acid_dt_cadastro =:dData where acid_cod = 1 ') I have the error message: 'Sybase SQL Anywhere:-157[Sybase][ODBC Driver]: cannot convert to the date/time ' Please, as I solve that? Obs: I want to use bind variable of the type Datetime. ...

how to convert date time to just date
 Hi Guys,               I am pulling a date from the datatable the formate i am getting is like this 8/14/2008 12:00:00 AM  but i don't want to show time with it.  I know i can get this by doing something like this Format(trainingExpiry, 'dd/mm/yyyy') AS trainingExpiry  in my SELECT statement but i dont want to do this in my select statement.  I want to change date format in my C# code.  Can anyone tell me please how can i get the desired date formate.  thanks in advance. ALI&...

Convert Hijri date to Gregorian date
I've searched and searched but cannot find much about converting a Hijri date to a Gregorian date. I can do the opposite fine, it's simply just creating a HijriCalendar object and passing a Gregorian date into one of the function which returns the correct Hijri date but I cannot reverse the steps to convert a Hijri date to a Gregorian date. Can someone help please? My code to convert Gregorian to Hijri is below:'Create an object of Hijri Calendar Dim calHijri As New System.Globalization.HijriCalendar 'Displays the converted date lblConvertedDate.Text = WeekdayName(calHij...

convert julian date to gregorian date
Did anybody can tell me if there exist function or code to convert julian date to gregorian and greorian date to julian date. Thank you very much excuse my english i am french canadian There are a couple of functions in the n_cst_datetime object in PFC that do that. If you don't want to use PFC, at least look at the code to see what they are doing. On Thu, 15 Feb 2001 12:04:55 -0500, in powersoft.public.powerbuilder.general cynthia ayotte <cynthia.ayotte@promutuel.ca> wrote: >Did anybody can tell me if there exist function or code to convert >julian date ...

Converting a date field to Julian date
Is there a way to convert a datetime field in sybase to a julian date? I have search and search and have not come up with any answer. TIA Mike I don't know how IQ works... I use this "formula" to convert the current date to julian format: select substring(convert(varchar(20),getdate(),112),1,4)+'/'+convert(varchar(20),da tediff(dd,convert(datetime,substring(convert(varchar(20),getdate(),112),1,4) ),convert(varchar(20),getdate(),112))) ~Luis <mevasquez> wrote in message news:4339c288.529b.1681692777@sybase.com... > Is there a way to convert ...

Convert Date type editmask to date
Hi, Why using date(em_1.text) will return 1900/01/01, but not the date I input? How to do it? Thanks!! Hi Chan What date format are you using i the editmask? The date function is using the system date format to convert the text to date first. If that does not work, it is using yyyy-mm-dd as format. HTH -- - Eric Aling [TeamPS], Cypres Informatisering bv, The Netherlands Eric's Home & PB Site @ http://utopia.knoware.nl/users/cypr115 Chan <chan1031@hotmail.com> wrote in message OEd$cLLK#GA.212@forums.powersoft.com... >Hi, > > W...

Drop down list with date only
Hi My maiden posting - I have been searching hi and low for an answer to this solution so I hope someone can help me . I have drop down list that feeds a gridview - I am doing a show by date queery for an asp.net page. The date time field from the database has both date and time values so I have to CONVERT the datetime value to get dates only ( many dates have many events). The following SQL returns the required list SELECT DISTINCT CONVERT (varchar, StartDate, 103) AS Expr1 FROM Memory ORDER BY Expr1  DESC  Now the problem is that when I do this the order of the dates is incorr...

How to use Convert date statement in cmdInsert.Parameters.Add("Date",SqlDbType.DateTime).Value = date
HiI am using SQL 2005, VB 2005I am trying to insert a record using parameters using the following code as per MotLey suggestion and it works finestring insertSQL; insertSQL = "INSERT INTO Issue(ProjectID, TypeofEntryID, PriorityID ,Title, Area) VALUES (@ProjectID, @TypeofEntryID, @PriorityID ,@Title, @Area)"; cmdInsert SqlCommand; cmdInsert=new SqlCommand(insertSQL,conn); cmdInsert.Parameters.Add("@ProjectID",SqlDbType.Varchar).Value=ProjectID.Text; My query is how to detail with dates my previous code wasinsertSQL += "convert(datetime,'" + DateTime.Now.ToSt...

How do order the list by date to show for new dates.
  <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NWHCConnectionString %>" SelectCommand="SELECT [Title], [URL], [Date] FROM [Article] ORDER BY [Date] DESC"></asp:SqlDataSource> <asp:Repeater id="myRepeaterUL" runat="server" DataSourceID="SqlDataSource1"> <HeaderTemplate> <ul> </HeaderTemplate> <ItemTemplate&...

Web resources about - order by convert date - sybase.sqlanywhere.ultralite

File:Convert to SVG and move to Commons.svg - Wikipedia, the free encyclopedia
As a courtesy (but not a requirement), please e-mail me or leave a note on my talk page if you use this image outside of Wikipedia. Thanks! As ...

Facebook Co-Founder Dustin Moskovitz Sells 450K Shares, Converts 7M More
The great Facebook stock sale frenzy continues on with a report that Co-Founder Dustin Moskovitz unloaded 450,000 shares in the social network ...

Facebook Announces “App2User” Liquidity Program for Merchants to Convert Rewards Points into Credits
... for Credits, just announced a new Credits program called “App2User,” designed to enable merchants and loyalty program operators to convert their ...

How to Convert Leads Into Buying Customers - The 9 Step Sales Process EVERYONE Should Use
... School of Business in Toronto on the topics of Sales and Entrepreneurship. I shared with them the sales process that I find How to Convert Leads ...

Bitcoin : Should I convert my savings to Bitcoin?
Answer (1 of 7): You should think of this question as "Should I invest all my savings in Bitcoin?", and not "Should I have my savings denominated ...

Convertizo 2 - Convert Units and Currency in Style on the App Store on iTunes
Get Convertizo 2 - Convert Units and Currency in Style on the App Store. See screenshots and ratings, and read customer reviews.

Catholics should not convert Jews, says Vatican, in push against anti-Semitism
... 50 years since the Vatican's repudiation of the concept of Jewish guilt for Jesus' death.  Vatican City: Catholics should not try to convert ...

Opinion: These 5 things made me a happy iPad Pro convert
... like I needed a bigger device. But after three weeks with my iPad Pro, several things have changed my mind, and I’m officially a happy convert ...

$100 device converts all your film to digital photos
... still on film negatives. Today, we've got the perfect Amazon Cyber Week deal for you: A Wolverine F2D Mighty 20MP 7-in-1 Film to Digital Converter ...

"ISIS 'ranks' the women, considering foreign women and converts to be especially 'valuable.' "
"According to French journalist Anna Erelle’s recent exposé , ISIS foreign fighters prefer foreign women and converts because the jihadists find ...

Resources last updated: 12/13/2015 12:53:46 PM