3초기억력

ASP - 오늘 날짜 구할때 본문

플밍_ASP

ASP - 오늘 날짜 구할때

잠수콩 2008. 11. 17. 12:02
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.


today_time = Year(now) & Right("0"&Month(now),2) & Right("0"&day(now),2)

대부분 sql 쿼리문 짤때 asp 단에서 저렇게 월/일을 2자리로 안하면, 쿼리가 안되는 경향이...

select * from 테이블 where convert(varchar(10), gedate(), 121) = '"& Year(now) &'-'& Right("0"&Month(now),2) &'-'& Right("0"&day(now),2) &"'"


select * from 테이블 where convert(varchar(8), gedate(), 112) = '"& Year(now) & Right("0"&Month(now),2) & Right("0"&day(now),2) &"'"

Comments