Click here to Skip to main content
15,895,656 members
Home / Discussions / C#
   

C#

 
AnswerRe: Hello Can you help? Pin
OriginalGriff15-Jun-10 22:05
mveOriginalGriff15-Jun-10 22:05 
QuestionHello Pin
levan omadze15-Jun-10 21:39
levan omadze15-Jun-10 21:39 
AnswerRe: Hello Pin
Peace ON15-Jun-10 21:44
Peace ON15-Jun-10 21:44 
QuestionYahoo woeid based weather forecasts Pin
faheemnadeem15-Jun-10 21:01
faheemnadeem15-Jun-10 21:01 
QuestionMicrosoft Word Viewer on C# Pin
Mohammad.Elcharfa15-Jun-10 20:51
Mohammad.Elcharfa15-Jun-10 20:51 
AnswerRe: Microsoft Word Viewer on C# Pin
Abhinav S15-Jun-10 21:46
Abhinav S15-Jun-10 21:46 
QuestionC# & SQL Datetime Pin
mrkeivan15-Jun-10 19:18
mrkeivan15-Jun-10 19:18 
AnswerRe: C# & SQL Datetime Pin
mrkeivan15-Jun-10 19:27
mrkeivan15-Jun-10 19:27 
Found it myself Big Grin | :-D
I used this function:

CREATE FUNCTION dbo.fnFormatDate (@Datetime DATETIME,  @FormatMask VARCHAR(32))

RETURNS VARCHAR(32)

AS

BEGIN

    DECLARE @StringDate VARCHAR(32)

    SET @StringDate = @FormatMask

    IF (CHARINDEX ('YYYY',@StringDate) > 0)

       SET @StringDate = REPLACE(@StringDate, 'YYYY', DATENAME(YY, @Datetime))

    IF (CHARINDEX ('YY',@StringDate) > 0)

       SET @StringDate = REPLACE(@StringDate, 'YY', RIGHT(DATENAME(YY, @Datetime),2))

    IF (CHARINDEX ('Month',@StringDate) > 0)

       SET @StringDate = REPLACE(@StringDate, 'Month', DATENAME(MM, @Datetime))

    IF (CHARINDEX ('MON',@StringDate COLLATE SQL_Latin1_General_CP1_CS_AS)>0)

       SET @StringDate = REPLACE(@StringDate, 'MON',

                         LEFT(UPPER(DATENAME(MM, @Datetime)),3))

    IF (CHARINDEX ('Mon',@StringDate) > 0)

       SET @StringDate = REPLACE(@StringDate, 'Mon', LEFT(DATENAME(MM, @Datetime),3))

    IF (CHARINDEX ('MM',@StringDate) > 0)

       SET @StringDate = REPLACE(@StringDate, 'MM',

                  RIGHT('0'+CONVERT(VARCHAR,DATEPART(MM, @Datetime)),2))

    IF (CHARINDEX ('M',@StringDate) > 0)

       SET @StringDate = REPLACE(@StringDate, 'M',

                         CONVERT(VARCHAR,DATEPART(MM, @Datetime)))

    IF (CHARINDEX ('DD',@StringDate) > 0)

       SET @StringDate = REPLACE(@StringDate, 'DD',

                         RIGHT('0'+DATENAME(DD, @Datetime),2))

    IF (CHARINDEX ('D',@StringDate) > 0)

       SET @StringDate = REPLACE(@StringDate, 'D', DATENAME(DD, @Datetime))   

RETURN @StringDate

END



dbo.fnFormatDate (SR.StuDateOfReg, 'M/DD/YYYY') >> 6/15/2010
AnswerRe: C# & SQL Datetime Pin
Bernhard Hiller15-Jun-10 21:04
Bernhard Hiller15-Jun-10 21:04 
AnswerRe: C# & SQL Datetime Pin
PIEBALDconsult16-Jun-10 14:00
mvePIEBALDconsult16-Jun-10 14:00 
JokeMehdi Pin
ShomaL University of AMOL15-Jun-10 18:43
ShomaL University of AMOL15-Jun-10 18:43 
JokeMehdi Pin
ShomaL University of AMOL15-Jun-10 18:42
ShomaL University of AMOL15-Jun-10 18:42 
GeneralRe: Mehdi Pin
Abhinav S15-Jun-10 19:48
Abhinav S15-Jun-10 19:48 
GeneralRe: Mehdi Pin
DaveyM6915-Jun-10 19:50
professionalDaveyM6915-Jun-10 19:50 
GeneralPost with proper subbject Pin
Khaniya15-Jun-10 20:08
professionalKhaniya15-Jun-10 20:08 
GeneralRe: Mehdi Pin
OriginalGriff15-Jun-10 21:33
mveOriginalGriff15-Jun-10 21:33 
AnswerThanks! Pin
venomation15-Jun-10 10:53
venomation15-Jun-10 10:53 
GeneralRe: Thanks! Pin
Abhinav S15-Jun-10 18:29
Abhinav S15-Jun-10 18:29 
QuestionI cannot find a proper way to do this can someone help Pin
safame2015-Jun-10 9:42
professionalsafame2015-Jun-10 9:42 
AnswerRe: I cannot find a proper way to do this can someone help Pin
Wes Aday15-Jun-10 11:11
professionalWes Aday15-Jun-10 11:11 
GeneralRe: I cannot find a proper way to do this can someone help Pin
Luc Pattyn15-Jun-10 11:30
sitebuilderLuc Pattyn15-Jun-10 11:30 
GeneralRe: I cannot find a proper way to do this can someone help Pin
Wes Aday15-Jun-10 12:50
professionalWes Aday15-Jun-10 12:50 
GeneralRe: I cannot find a proper way to do this can someone help Pin
Luc Pattyn15-Jun-10 13:05
sitebuilderLuc Pattyn15-Jun-10 13:05 
GeneralRe: I cannot find a proper way to do this can someone help Pin
Wes Aday15-Jun-10 13:53
professionalWes Aday15-Jun-10 13:53 
GeneralRe: I cannot find a proper way to do this can someone help Pin
safame2015-Jun-10 11:38
professionalsafame2015-Jun-10 11:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.