For Ken Haley

Posted on 2007-07-23
Last Modified: 2010-04-15
Continuation from last post:  C# code used to build the query...

            string selectString = "select COUNT(*) from tBooks where DateU > '" + lastExport.ToString("dd MMM yyyy") + "'";
            traceSource.TraceInformation("selectString: " + selectString);

            SqlDataReader rdr = null;
            if (bookConn.State == ConnectionState.Closed)

            SqlCommand cmd = new SqlCommand(selectString, bookConn);
            rdr = cmd.ExecuteReader();

            lBooksWaiting.Text = rdr[0] + " books waiting to be exported";  //  on import/export tab


Question by:rmmarsh
    LVL 20

    Expert Comment

                lBooksWaiting.Text = rdr[0] + " books waiting to be exported";  //  on import/export tab

    I am a bit in the dark without a question, but....

    LVL 20

    Expert Comment

    you might aswell expose the question to everyone in here as you will have a better chance of getting an answer. :-)

    Author Comment

    Ahhh... the question resulted from another question regarding internationalization of dates.  Ken suggested I use the format "yyyy mm dd" and I indicated that the SQL statement barfed on the resulting date of '2007 32 22'...
    I have successfully used "dd MMM yyyy", but he suggests that it is not bullet proof for all countries, which I agree; but when I convert current date to a string using the format "yyyy mm dd" it returns '2007 32 22' which SQL says is invalid (Duh!)
    LVL 96

    Expert Comment

    by:Bob Learned
    yyyy mm dd = Year Minutes Day
    yyyy MM dd = Year Month Day

    LVL 1

    Accepted Solution

    PAQed with points refunded (500)

    EE Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now