Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 13th, 2007, 03:01 AM
Authorized User
 
Join Date: Jul 2006
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help with date format

Hi

I hav an application that record printing information. I am wanting to import the .log file that it creats into a sql db so that I can use RS ro create reports for our users. I have crerated a dts package to do the import - it all works fine untill I query the db - the date is in the format mm/dd/yyyy in the log file and therfore also in my sql db. The problem is that some of the date formats when quering show up as mm/dd/yyyy and the some of them appear as dd/mm/yyyy.

Is there a way to force the query to convert the date type to dd/mm/yyyy (i have used convert(varchar(10)date, 103) as Date) but this does not work. Also could there be a better way using a SP. I am new the DBA so please bear with me and thank you in advance

Greg
 
Old February 13th, 2007, 10:15 AM
Authorized User
 
Join Date: Dec 2006
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your syntax is not correct using the CONVERT function.
Try... CONVERT(varchar(10), GETDATE(), 103).

Adam Gossage
Lake Wylie, SC, USA





Similar Threads
Thread Thread Starter Forum Replies Last Post
date format differs, need to force format somehow patricolsson ASP.NET 2.0 Basics 1 December 3rd, 2009 12:53 AM
Convert British format date to American format? fyr PHP How-To 0 December 19th, 2007 03:17 PM
Format Date Tim Johnson Access 1 December 17th, 2007 08:18 AM
How to give Date format while entering date Subuana Beginning VB 6 4 March 17th, 2006 07:25 AM
date format differs, need to force format somehow patricolsson HTML Code Clinic 2 January 12th, 2006 05:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.