|
|
|
|
俵ÀÌ / 2001-03-16 / ¿ÀÈÄ 9:44:32 / 211.220.12.46
Á¶È¸¼ö : 130
|
[Áú¹®] Çѹø »ì·ÁÁÖ¼¼¿ä... ¤Ð¤Ð |
> ---- ¿¡·¯ ¸Þ½ÃÁö ----
> ¿À·ù Çü½Ä:
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect
> syntax near '¿ÀÈÄ'.
>
>
> ---- ¿¡·¯¶óÀÎÀÇ ÄÚµå ----
> <%
> Set Conn = Server.CreateObject("ADODB.Connection")
> Conn.Open "Book_listdb","sa","1465215"
>
> a = now()
> response.write a
> b = a-30
> response.write b
> Set Rs = Server.CreateObject("ADODB.RecordSet")
> Sql = "select
> number,book_name,author_name,publish,cost,reg_date,class1 from
> book_insert where pub_date between "&a&" and "&b&""
> Rs.Open Sql, Conn,1,2,1
> number = Rs("number")
> book_name = Rs("book_name")
> author_name = Rs("author_name")
>
> conn.close
> set conn = nothing
>
> %>
>
> ---- Áú¹® ³»¿ë ----
> µµ¼°ü¸® ÇÁ·Î±×·¥À» ÀÛ¼ºÁßÀε¥.. db¿¡´Â ÇöÀç Ã¥ÀÇ Ãâ°£ÀÏÀ» ³ªÅ¸³»´Â
> pub_date¿Í »çÀÌÆ®¿¡ µî·ÏÇÑ ³¯Â¥ÀÎ reg_date°¡ ÀÖ½À´Ï´Ù.
> ½Å°£µµ¼¶ó´Â ¸Þ´º¸¦ À§Çؼ ³¯Â¥¸¦ ¼Ò½ºÃ³·³ ÄÚµùÇØ º¸¾Ò´Âµ¥...
> ¿µ ¾ÈµÇ³×¿ä. ÇöÀç ½Ã°£ºÎÅÍ Ã¥ÀÇ Ãâ°£ÀÏÀÌ 30ÀÏ ÀÌÀüÀÎ °Í¸¸ ½Å°£À¸·Î
> select Çؼ Ã¥ÀÇ ´ëºÐ·ùÀÎ class1¿¡ µû¶ó ½Å°£À» »Ñ·ÁÁÖ¾î¾ß Çϰŵç¿ä.
> ±×·±µ¥... À§¿Í °°Àº ¿¡·¯°¡ ÀÌÃʺ¸ÀÇ ¹ß¸ñÀ» ²Ë ºÙÀâ´Â ±º¿ä..¤Ð¤Ð¤Ð
> Âü°í·Î pub_date¿Í reg_dateÀÇ µ¥ÀÌÅÍÇüÀº datetimeÇüÀ̱¸¿ä.
> ¿¡·¯¿¡¼ ó·³ ³â ¿ù ÀÏ ±îÁö ºñ±³ÇÏ´Ù°¡ "¿ÀÈÄ~~~"¿©±â¼ ºñ±³°¡ ¾ÈµÇ
> ´Â°Í °°Àºµ¥... ÇØ°áÇÒ ¹æ¹ý ¾ø½À´Ï±î?
> ²À Á» ¾Ë·ÁÁÖ¼¼¿ä.
> ±×¸®°í ¶Ç ÇÑ°¡Áö...
> group by ¹®¹ý¿¡´ëÇؼµµ...
> ¿Ö³Ä¸é Ã¥ÀÇ ºÐ·ù¿¡ ¼ÓÇÏ´Â class1 Çʵ忡´Â "ÄÄÇ»ÅÍ ÀϹÝ", "¿ÀÇǽº ÀÏ
> ¹Ý", "ÇÁ·Î±×·¡¹Ö ¾ð¾î",,,,,,µîµîÀÌ Àִµ¥ ³¯Â¥¸¦ Á¶»çÇÑÈÄ ³¯Â¥ Á¶°Ç¿¡
> ¸Â´Â ·¹Äڵ带 ãÀºÈÄ class1¿¡ °°Àº ºÐ·ù¿¡ ¼ÓÇÏ´Â °Íµé¸¸ group º°·Î
> »Ñ·Á ÁÖ¾î¾ß Çϰŵç¿ä.
> Á¦¹ß Àú Çѹø µµ¿Í ÁÖ¼¼¿ä.
>
>
-----------------------------------------------------------
datetimeÇüÀº Ưº°ÇÑ µ¥ÀÌŸÇüÀÔ´Ï´Ù.
ȸ鿡 2000³â 12¿ù 31ÀÏÀ̶ó°í Ãâ·ÂµÇ´õ¶ó°í ½ÇÁ¦·Î datetimeÇü¿¡´Â ±× °ªÀÌ µé¾î Àִ°ÍÀÌ ¾Æ´Ï°í
Ư¼öÇÑ ¼ýÀÚÇüÅ·Πµé¾î°¡ ÀÖ´Â °ÍÀÔ´Ï´Ù.
Áï ¹®ÀÚ¿Í´Â ºñ±³°¡ µÇÁö ¾Ê½À´Ï´Ù.
datetimeÇüÀ¸·Î ¼±¾ðÇϸé now·Î´Â °ªÀ» ÀÔ·ÂÇÒ ¼ö ¾ø´Â °Í°ú °°½À´Ï´Ù.
ºñ±³ÇϽ÷Á¸é getdate¸¦ ÀÌ¿ëÇÏ¼Å¾ß ÇÒ °ÍÀÔ´Ï´Ù.
°Ë»öÇØ º¸½Ã±æ....
|
|
|
|