SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 21st, 2003, 05:49 PM
jorthuis jorthuis is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 jorthuis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 28 sec
Reputation Power: 0
Still struggeling for life with dates

I don't now it anymore now.
I created a page where you can see what's happening

URL

Just click on the different dates en see the results

You'll see that 06/01/2004 is not working.

I need to reformat the date before it is given to the query. Can show me how to do that.

So the date that i have from the resultpage, that date is the date that i'm using in the hyperlink, i need to swap days and months before the query is send to the db.

I hope that i'm not to confusing here.

Last edited by dcarva : September 22nd, 2003 at 03:16 PM.

Reply With Quote
  #2  
Old September 22nd, 2003, 03:19 PM
dcarva's Avatar
dcarva dcarva is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 633 dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 18 m 20 sec
Reputation Power: 6
I can't get to the page...get a server not found error.

Reply With Quote
  #3  
Old September 22nd, 2003, 03:28 PM
dcarva's Avatar
dcarva dcarva is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 633 dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 18 m 20 sec
Reputation Power: 6
This works for SQL Server, not sure about Access though...are you using Access or SQL Server? - someone else had posted this before.

(Replace DateFieldName with the name of your date field and TableName with the name of your table.)

SELECT CONVERT(varchar(11), DateFieldName, 103) AS Expr1
FROM TableName

Reply With Quote
  #4  
Old October 9th, 2003, 10:25 AM
m_lazor m_lazor is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Luxembourg
Posts: 156 m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Attention!
Converting a date with Convert includes several options like the 103 param indicates a British/French "dd/mm/yy" date and the fact that it is > 100 means that centuries are included in the format. Therefore I recommend reading Transact SQL Help for Convert f.e.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Still struggeling for life with dates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway