472,111 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,111 software developers and data experts.

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 3325
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.