help me this SQL 
Author Message
 help me this SQL

Hi, all friends:

I have two question:

I have a access database, and i have a field call date in customer table.

No 1. I want to retrieve all the customer which the date is between 1/1/2000 to 1/4/2000
how can i write this SQL?

No 2. I also want to set the date format is dd/mm/yyyy, no matter how the customer computer date setting.
how do i do this?

Thank you in advance.

Hongwei



Sun, 22 Sep 2002 03:00:00 GMT  
 help me this SQL

No 1. "SELECT * FROM tbl WHERE fldDate Between #1/1/2000# and #1/4/2000#;"
Use the pound Symbol (#) to inclose the date.

No 2.
take a look at the FormatDateTime Function
value = FormatDateTime(Date, NamedFormat)

      vbGeneralDate 0 Display a date and/or time. If there is a date part, display it as a short date. If there is a time part, display it as a long time. If present, both parts are displayed.  
      vbLongDate 1 Display a date using the long date format specified in your computer's regional settings.
      vbShortDate 2 Display a date using the short date format specified in your computer's regional settings.
      vbLongTime 3 Display a time using the time format specified in your computer's regional settings.
      vbShortTime 4 Display a time using the 24-hour format (hh:mm).

Function GetCurrentDate
  ' FormatDateTime formats Date in long date.
    GetCurrentDate = FormatDateTime(Date, 1)
End Function


  Hi, all friends:

  I have two question:

  I have a access database, and i have a field call date in customer table.

  No 1. I want to retrieve all the customer which the date is between 1/1/2000 to 1/4/2000
  how can i write this SQL?

  No 2. I also want to set the date format is dd/mm/yyyy, no matter how the customer computer date setting.
  how do i do this?

  Thank you in advance.

  Hongwei



Fri, 18 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. SQL Help (WWW to SQL)

2. SQL HELP: Access to SQL Server

3. HELP / HELP / syntax SQL / 'LIKE' clause

4. Help connecting to SQL

5. Help creating an SQL Statement

6. Help please with SQL Statements

7. Help with complex SQL statement

8. Help with ADOBD sql call from VBScipt

9. Help Needed with SQL statement

10. HELP - ASP Calling SQL Server Stored procedure

11. I need help disconnecting fro SQL Server....

12. Help to Understand SQL

 

 
Powered by phpBB® Forum Software