469,283 Members | 2,263 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,283 developers. It's quick & easy.

Format(Date, "MM/DD/YYYY")

16
Hello,

How can I porting this code

to_date('" & Format(Date, "MM/DD/YYYY") & "','mm/dd/yyyy')

from VB to aspx?

SelectCommand="SELECT * FROM tbl_Products
WHERE tbl_Products.ProductStartDate <= to_date('" & Format(Date, "MM/DD/YYYY") & "','mm/dd/yyyy')"

Thanks,Sabina
Jan 15 '07 #1
6 3200
kenobewan
4,871 Expert 4TB
Format(Date, "MM/DD/YYYY")
Jan 16 '07 #2
Sabina
16
Hello,

I don't undestand.
I can't replace

to_date('" & Format(Date, "MM/DD/YYYY") & "','mm/dd/yyyy') (from VB) to
Format(Date, "MM/DD/YYYY")

How can I port to_date('" & Format(Date, "MM/DD/YYYY") & "','mm/dd/yyyy') from VB to asp.net?




Thanks,Sabina
Jan 16 '07 #3
Sabina,

The below link explains all date formating. Check it.

http://msconline.maconstate.edu/tuto...bnet01-08.aspx



Ambika Praveen.
Jan 16 '07 #4
Sabina
16
I get the error message :"Cannot switch views:(validation (asp.net):If this attribute value is enclosed in quotation marks,the quotation marks must match.


SelectCommand="SELECT Product_Code, Product_ID FROM tbl_Employees,tbl_Factories,tbl_Product_categories ,tbl_Products
WHERE tbl_Factories.Factory_ID = tbl_Product_categories.Factory_ID
AND tbl_Product_categories.Product_category_ID = tbl_Products.Product_category_ID
AND tbl_Employees.Employee_ID = tbl_Product_categories.Product_category_Manager_ID
AND tbl_Products.ProductStartDate <= to_date('" & Format(Date, "MM/DD/YYYY") & "','mm/dd/yyyy')"

If I close SelectCommand
SelectCommand="SELECT Product_Code, Product_ID FROM tbl_Employees,tbl_Factories,tbl_Product_categories ,tbl_Products
WHERE tbl_Factories.Factory_ID = tbl_Product_categories.Factory_ID
AND tbl_Product_categories.Product_category_ID = tbl_Products.Product_category_ID
AND tbl_Employees.Employee_ID = tbl_Product_categories.Product_category_Manager_ID "

without the last line I getn't the errors.


Thanks,Sabina
Jan 16 '07 #5
Sabina
16
Hello,

How can I port >= ?


Thanks,Sabina
Jan 16 '07 #6
kenobewan
4,871 Expert 4TB
I suggest placing the datetime in a variable first, formatting the date and then using it in your select statement. You have already debugged and established the problem, now take this further. Display the variable if it is still not working to see why it might not work...
Jan 17 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Erik R.N. | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.