ORDER BY [Date] isn't working since it's not a DateTime (it's a varchar!)

Hi everyone.

I know, I know, it should have been a datetime from the start...but here's the problem.
I'm trying to sort by my date field but because it looks like: "04/03/2004 12:14:21 PM" it's not ordering it properly using:
ORDER BY [Date]
Are there any work arounds for this? Is there some way of doing:
ORDER BY covert(datetime, [Date], 103) or something?
Cheers
Andrew
www.codingmayhem.com - VB.NET, C#, Silverlight, Javascript, HTML, CSS, T-SQL, MySQL and SQLite
www.headshotgamer.com - Gaming News and Reviews
0
andrewphq
3/4/2004 6:22:37 AM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

3 Replies
829 Views

Similar Articles

[PageSpeed] 8

SELECT Convert(datetime, [Date], 103), Columnnames FROM TABLENAME

ORDER BY 1
0
etekglobalinc
3/4/2004 1:45:18 PM
Worked perfectly, though I chosed to:

SELECT convert(datetime, [Date], 103) AS 'Converted'
WHERE ...
ORDER BY Converted
just for looks :)
Thanks again!
www.codingmayhem.com - VB.NET, C#, Silverlight, Javascript, HTML, CSS, T-SQL, MySQL and SQLite
www.headshotgamer.com - Gaming News and Reviews
0
andrewphq
3/5/2004 3:06:08 AM
Reply:

Similar Artilces:

How to convert MS SQL's 'smalldatetime' to PB 'date' in DW?
Suppose I have a Powerbuilder datawindow with a column of type 'date'. I also have a MS SQL 7 database table with a column of type 'date' where 'date' is a MS SQL's user defined type which maps to MS SQL's 'smalldatetime'. Now I retrieve the datawindow. On Windows XP Professional in the datawindow I have a beautiful date, let's say '1-2-03' but on Windows 95 I have garbage: '??-??-1241' or similar. Here is my question: how to convert the MS SQL's 'smalldatetime' value to the PB 'date' type 'on-the...

Messages don't always get sent if computer's date isn't right
I've found that if my computer's date is off by more than some unknown amount, when I send a message it doesn't always really get sent. Yet I don't get an error indication, and the message appears in my Sent folder right along with the rest of my sent messages. Anyone know how much my computer's date can differ from true time before this problem appears? Some of my messages to newsgroups had their dates off by two years, but still got posted. A few minutes ago, I sent two eamils to myself, one with my computer set to September 28, 2009 (one month error)...

Repost: FF won't show gif's nor jpg's Red X's
XP sp2 FF 2.0.0.4 extentions: Adblock Plus Copy plain text Fasterfox Firebug FireFTP McAfee SiteAdvisor NoScript Talkback Video Downloader Pic's show red x's. These pics show just fine in Internet Explorer and Netscape. Anyone have any ideas????? Fasterfox, I guess. See what happens if you disable it (or just disable its pipelining feature). -- �Q� =============== Thank you Q. I disabled all of them, one at a time (restarting each time) and the problem still exists :-( digimomma On 7/12/2007 5:26 PM digimom inquired: > Thank y...

Replace 1's and 0's in a gridview column with Yes's and No's
Is it possible to change the display of a column in a gridview to show a Yes for all 1's and a No for 0's that display in a particular column of a gridview bound to a database?  If so, can someone share the way with me?  I am using ASP.NET 2.0 with VB Code Behind.  Thanks One way you can do is thrrough  CASE in your select statement: Select YesNoColumn= CASE yourColumn WHEN 1 THEN 'Yes' WHEN 0 THEN 'No' ELSE '' END FROM YourtableLimno <Columns>     <asp:TemplateField HeaderText="yourHeader" SortExpression="yourDataField"> ...

'Tab' control 's visible doesn't work.Why?
I use tab control in my applition. And I set visible=false, but it doesn't work. my code is: ----------------------------------------------- <asp:ScriptManager ID="ScriptManager1" runat="server" />  <div>   <ajaxToolkit:TabContainer runat="server" ID="Tabs" Height="138px" ActiveTabIndex="0"    Width="402px">    <ajaxToolkit:TabPanel runat="server" ID="Panel1" HeaderText="Tab1" Visible="f...

It's Linux !? No, it's BSD ! No, no, it's...
kFreeBSD http://wiki.debian.org/Debian_GNU/kFreeBSD a Debian distro using the FreeBSD kernel ! ObiWan wrote: > kFreeBSD > > http://wiki.debian.org/Debian_GNU/kFreeBSD > > a Debian distro using the FreeBSD kernel ! Why use a BSD kernel? I hope the reason is more than, just because they can. http://wiki.debian.org/Debian_GNU/kFreeBSD_why It's easy to understand why the would want to use Debian packages. :) -- Jimmy Johnson Registered Linux User #380263 >> kFreeBSD >> >> http://wiki.debian.org/Debian_GNU/kFreeBSD >> ...

''''''''''''''''''''
Name: haznen Email: haznenatyahoodotcom Product: Gran Paradiso Alpha 8 Summary: '''''''''''''''''''' Comments: '''''''''''''''''''''''''''''''''''' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 UGES/1.7.2.0 GranParadiso/3.0a1 From URL: http://www.mozilla.org/projects/granparadiso/ Note to readers: Hendrix gives...

TWC's online DVR Manager's record options don't work?
Hello. Does any SeaMonkeyers else have a DVR, from TWC that can be accessed remotely through https://dvr.timewarnercable.com/tvListings/? If so, then are you able to click on all record options (change to don't delete and series)? They don't seem to work in two/2 of my SeaMonkey v2.26.1 web browsers on two/2 different machines (Debian and Windows XP Pro SP3). It worked fine in Internet Explorer v8.0 and Firefox/Iceweasel v31 though. Thank you in advance. :) -- "A centipede is an ant made to Canadian/government specs." --unknown /\___/\ Ant(Du...

can't get reports 'Old Chart's and 'New Charts' to work properly
1. If I try and draw a chart it doesn't go beyond June of this year so I'm missing a lot of data in the output. 2. Is there a reason for this - I have been modding bugzilla so that it has an extra status field from earlier this year - would that have had an impact ? 3. Also when I try and do a Old Chart or NewChart I can't see my new 'Status' field to select - this is ok if I do a bar chart though. cheers On Mon, 2011-12-05 at 03:25 -0800, nothtb@ukonline.co.uk wrote: > 1. If I try and draw a chart it doesn't go beyond June of this year so &g...

DLL's obfuscated using DotFuscator when deployed don't work and the DLL's are easily decompiled. What to do?
I used DotFuscator Community edition that ships with VS2005 to obfuscate some of the DLL's from my PreCompiled website. When I deploy these obfuscated DLL's on the webserver, my site doesn't work. If I revert back to my old DLL's fo my precompiled website, it works fine. Secondly, the DLL's obfuscated with DotFuscator Community Edition are easily decompiled to the original source code using a decompiler like Salamander .NET decompiler (http://www.remotesoft.com/salamander/). Then, whats the use of this DotFuscator if it can't obfuscate the DLL's. Ple...

Help! I cannot access the DataGrid's ItemTemplate's LinkButton's Text Atrribute 's Value!!!!!!!!!!!
I write a datagrid's ItemDataBound method as follows:   private void dgTable_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)  {   if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)   {    if(!isRole("Manager"))    {     LinkButton tmp = (LinkButton)e.Item.FindControl("lbPassed");     if(tmp.Text == "Passed")     {      ((LinkBu...

'do' won't 'do' if '/'
Greetings to All from Au, Have a NetWare Perl 5.8.4 and wanted to tweak File\Spec\NW.pm to try and standardise on '/' separators. If I run a test script (t/uni/lower.t) with an unmodified NW.pm, it calls t/uni/case.pl, that, in case.pl, (when the path separators are '\'), the $file is '..\lib\unicore\To\Lower.pl' and the following code portion works, with $simple getting a returned table: sub casetest { my ($base, $spec, $func) = @_; my $file = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "lib", &qu...

Hyperlink's, ImageURL's, and OnError's
I created an ASP:Hyperlink and set the ImageURL attribute so the link will be the image.If the image is missing, I would like it to display a 'missing image' pic that I have.  I know you can use the OnError attribute of the <img> tag to run some javascript to change it.Unfortunately I can't find a way to access the Hyperlink's Image that is inside it, so I can add an Attribute so the resulting <img> tag will have an OnError attribute inside of it.Any help?If my Hyperlink is called 'foo'....would I do...  ((Image) foo.Controls[0]).Attributes.Add(&...

'''''
Name: mario Email: ramar17atfastwebnetdotit Product: Gran Paradiso Alpha 2 Summary: ''''' Comments: K: Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2) Gecko/20070206 GranParadiso/3.0a2 ...

Web resources about - ORDER BY [Date] isn't working since it's not a DateTime (it's a varchar!) - asp.net.sql-datasource

Resources last updated: 12/31/2015 12:06:10 AM